使用HttpClient发送GET请求
来源:互联网 发布:vba聊天软件 编辑:程序博客网 时间:2024/05/21 19:21
HttpRequestMessage http_req_msg = new HttpRequestMessage();http_req_msg.Method = HttpMethod.Get;http_req_msg.Headers.Add("user-agent", "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)");http_req_msg.RequestUri = new Uri("http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl"); HttpClient httpclient; HttpClientHandler httphandler; httphandler = new HttpClientHandler();httphandler.AllowAutoRedirect = false;httphandler.UseCookies = false;httpclient = new HttpClient(httphandler);var task = httpclient.SendAsync(http_req_msg);task.Result.EnsureSuccessStatusCode();HttpResponseMessage response = task.Result;var result = response.Content.ReadAsStringAsync();string responseBodyAsText = result.Result;responseBodyAsText = responseBodyAsText.Replace("<br>", Environment.NewLine); // Insert new linesMessageBox.Show(responseBodyAsText);
0 0
- 使用HttpClient发送GET请求
- 使用httpclient发送get请求
- 使用Apache HttpClient发送get、post请求
- 使用HttpClient发送https请求GET方式
- 使用HttpClient发送GET和POST请求
- 使用httpclient发送get/post请求
- 使用httpclient发送get或post请求
- httpclient 发送get请求 。
- HttpClient发送get请求
- Java使用HttpClient发送Get请求和Post请求
- Android使用Apache HttpClient发送GET、POST请求
- Android笔记---使用HttpClient发送POST和GET请求
- android_30_使用HttpClient发送Get和Post请求
- Java使用HttpClient发送Get和Post请求
- java使用HttpClient模拟发送http的get、post请求
- 使用HttpClient发送带body的GET请求
- httpClient使用,1 发送post请求 2 发送get请求取得接口中的数据
- java httpclient发送post get 请求
- OpenCV Error::: bad flag(parameter or structure field)(Unrecognized or unsupported array type)
- 140702
- RDF
- 随机打印50个随机(4-10长度)的字符串
- Android AIDL原理
- 使用HttpClient发送GET请求
- 【数字图像处理之(四)】用图像增强谈灰度直方图
- 黑马程序员——黑马学习日志之四 Java基础——数组
- LR
- 视频编解码学习之一:理论基础
- Oracle merge使用
- JTA(JAVA Transaction Api)事务
- 有关UIView、subview的几个基础知识点-IOS开发 (实例)
- 官方文档 恢复备份指南五 Configuring the RMAN Environment