示例#1
0
        public async Task <string> HttpPostAsync(string url, string formdata = null, int timeout = 0, string userAgent = UserAgent, IDictionary <string, string> headers = null, IWebProxy proxy = null)
        {
            byte[]          buffer = Encoding.UTF8.GetBytes(formdata);
            HttpWebResponse resp   = await _HttpPostAsync(url, buffer, timeout, userAgent, headers, proxy);

            return(await resp.GetResponseStringAsync());
        }
示例#2
0
        public async Task <string> HttpGetAsync(string url, int timeout = 0, string userAgent = UserAgent, IDictionary <string, string> headers = null, IWebProxy proxy = null)
        {
            HttpWebResponse resp = await _HttpGetAsync(url, timeout, userAgent, headers, proxy);

            return(await resp.GetResponseStringAsync());
        }
        public static async Task <string> HttpPostAsync(string url, byte[] buffer, int timeout = 0, string userAgent = UserAgent, string cookie = null, IDictionary <string, string> headers = null, IWebProxy proxy = null)
        {
            HttpWebResponse resp = await _HttpPostAsync(url, buffer, timeout, userAgent, cookie, headers, proxy);

            return(await resp.GetResponseStringAsync());
        }