Beispiel #1
0
        public Task <SNHttpWebResponse> PostRequestAsync(string serviceUrl, Dictionary <string, string> headers = null, string postData = "", string contentType = "")
        {
            Task <SNHttpWebResponse> postResult = new Task <SNHttpWebResponse>(() => {
                SNHttpWebResponse response = CommonHttpRequest(serviceUrl, WebRequestMethods.Http.Post, headers, postData, contentType);
                return(response);
            });

            postResult.Start();
            return(postResult);
        }
Beispiel #2
0
        public Task <SNHttpWebResponse> GetRequestAsync(string serviceUrl, Dictionary <string, string> headers = null)
        {
            Task <SNHttpWebResponse> getResult = new Task <SNHttpWebResponse>(() => {
                SNHttpWebResponse response = CommonHttpRequest(serviceUrl, WebRequestMethods.Http.Get, headers);
                return(response);
            });

            getResult.Start();
            return(getResult);
        }