你的位置:首页 > 软件开发 > ASP.net > C# 发送Http请求

C# 发送Http请求

发布时间:2016-06-19 21:00:09
WebClient位于System.Net命名空间下,通过这个类可以方便的创建Http请求并获取返回内容。一、用法1 - DownloadDatastring uri = "http://hovertree.top/";WebClient wc = new ...

WebClient位于System.Net命名空间下,通过这个类可以方便的创建Http请求并获取返回内容。

一、用法1 - DownloadData

get='_blank'>string uri = "http://hovertree.top/";WebClient wc = new WebClient();Console.WriteLine("Sending an HTTP GET request to " + uri);byte[] bResponse = wc.DownloadData(uri);string strResponse = Encoding.ASCII.GetString(bResponse);Console.WriteLine("HTTP response is: ");Console.WriteLine(strResponse);// 何问起

原标题:C# 发送Http请求

关键词:C#

C#
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录