其他分享
首页 > 其他分享> > 读http请求内容

读http请求内容

作者:互联网

 			string rl;
            WebRequest myReq=WebRequest.Create("https://www.baidu.com/");
            WebResponse myRes = myReq.GetResponse();
            Stream resStream = myRes.GetResponseStream();
           
            StreamReader sr = new StreamReader(resStream, Encoding.UTF8);
            StringBuilder sb = new StringBuilder();
            while ((rl = sr.ReadLine()) != null)
            {
                sb.Append(rl);
            }
            myRes.Close();

标签:myRes,resStream,http,请求,WebRequest,内容,rl,new,StreamReader
来源: https://blog.csdn.net/qq1142596685/article/details/119176741