示例#1
0
        public string Request(string url, HttpRequestParameter parameter, HttpMethod method, HttpHeader headers)
        {
            string _params = string.Empty;

            if (parameter != null && parameter.Count > 0)
            {
                _params = parameter.ToString();
            }


            if (method == HttpMethod.GET)
            {
                if (url.Contains("?"))
                {
                    url = url + "&" + _params;
                }
                else
                {
                    url = url + "?" + _params;
                }

                return(HttpGet(url, headers));
            }
            else
            {
                return(HttpPost(url, _params, headers));
            }
        }
示例#2
0
 public string Request(string url, HttpRequestParameter parameter, HttpMethod method)
 {
     return(Request(url, parameter, method, null));
 }