AuScGen.CommonUtilityPlugin.HttpRestClient.postRequest C# (CSharp) Method

postRequest() public method

Gets the request.
public postRequest ( string url, string>.Dictionary requestParamDic ) : string>.Dictionary
url string The URL.
requestParamDic string>.Dictionary The request parameter dic.
return string>.Dictionary
        public Dictionary<string, string> postRequest(string url, Dictionary<string, string> requestParamDic)
        {
            httpPost = new HttpPost(new Uri(url));
            foreach (KeyValuePair<string, string> entry in requestParamDic)
            {
                httpPost.Parameters.Add(entry.Key, entry.Value);
            }
            //Get the response
            response = client.Execute(httpPost);
            //Get the response string
            string responseString = EntityUtils.ToString(response.Entity);
            //Get the Response Code and Save it
            string responseCode = response.ResponseCode.ToString();
            //Parse the response and return the values in the Dictionary
            Dictionary<String, String> responseCollection = null;
            if (responseCode == "200" && response != null)
            {
                //Console.WriteLine("Received the response" + responseString);
                responseCollection = new Dictionary<string, string>();
            }
            else
            {
                //Console.WriteLine("No Result returned");
            }
            return responseCollection;
        }