HttpWebRequest && WebResponse
2016-06-06 21:39
543 查看
public class Program { public static void Main(string[] args) { RequestData("http://www.baidu.com"); Console.ReadLine(); } public static async void RequestData(string uri) { HttpWebRequest httpWebRequest = WebRequest.CreateHttp(uri); WebResponse webResponse =await httpWebRequest.GetResponseAsync(); Stream stream = webResponse.GetResponseStream(); StreamReader sr = new StreamReader(stream, System.Text.Encoding.UTF8); Console.Write(sr.ReadToEnd()); } }
相关文章推荐
- Redis Creating Server TCP listening socket *:6379: unable to bind socket
- 如何简单形象又有趣地讲解神经网络是什么?
- TCP/IP入门(3) --传输层
- DAY6 处理http头,格式化输出
- TCP\UDP
- OkHttp 3.0之后版本GET、POST请求以及POST上传文件的示例代码
- CentOS 配置网络
- HTTP 工作原理
- ionic入门教程第十七课-深入讲解与服务器的交互$http、$q、设置头部、不包括$resourse
- HTTP网络请求过程几点说明
- AFNetworking实现网络请求
- Retrofit 2.0 超能实践(一),okHttp完美支持Https传输
- Retrofit 2.0 超能实践,完美支持Https传输
- Python 网络套接字编程
- Android HttpURLConnection的简单使用
- 网络资源
- HTTP协议报文、工作原理及Java中的HTTP通信技术详解
- socket与TCP/UDP编程
- http协议下的keep alive
- 腾讯兴趣部落可以发外部链接了