WIn8上数据请求方式请求方式。

8 篇文章 0 订阅

From the .NET FrameWork.

WebRequest:没有UserAgent属性,HttpWebRequestUserAgent属性,


HttpWebRequest:WebRequestHTTP实现,这正好说明了,UserAgentHTTP的一部分。


WebClient:是对HttpWebRequest的进一步封装,而WebClient中又多出一种设置UserAgent的形式


HttpClient: is amodern HTTP client for .NET. It providesa flexible and extensible API foraccessing all things exposed through HTTP.

It   is the main class for sending and receiving HttpRequestMessages and HttpResponseMessages. If you are used to usingWebClient or HttpWebRequest then it is worth noting that HttpClient differs insome interesting ways – here’s how to think about an HttpClient:
  1. An HttpClient instance is the place to configure extensions, set default headers, cancel outstanding requests and more.同意处理
  2. You can issue as many requests as you like through a single HttpClient instance.,支持单实例的并发
  3. HttpClients are not tied to particular HTTP server or host; you can submit any HTTP request using the same HttpClient instance.
  4. You can derive from HttpClient to create specialized clients for particular sites or patterns,可以自定义派生类
  5. HttpClient uses the new Task-oriented pattern for handling asynchronous requests making it dramatically easier to manage and coordinate multiple outstanding requests.
From the control.
WEBBrowser:通过webbrowser来加载和显示数据,完整的封装。detail please see http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx

HttpWebRequest vs Microsoft.XMLHTTP
HttpWebRequest and HttpWebResponse are the way to go if you want to use pure .NET. 
XmlHttp uses the Microsoft unmanaged XML parser DLL. detail please see the http://msdn.microsoft.com/en-us/library/ms537505(v=vs.85).aspx
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值