Encoding trouble with HttpWebResponse

后端 未结 7 1667
时光取名叫无心
时光取名叫无心 2020-11-29 07:27

Here is a snippet of the code :

HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(request.RawUrl);
WebRequest.DefaultWebProxy = null;//Ensure that         


        
7条回答
  •  孤城傲影
    2020-11-29 07:49

    I studied the same problem with the help of WireShark, a great protocol analyser. I think that there are some design short coming to the httpWebResponse class. In fact, the whole message entity was downloaded the first time you invoking the GetResponse() method of the HttpWebRequest class, but the framework have no place to hold the data in the HttpWebResponse class or somewhere else, resulting you have to get the response stream the second time.

提交回复
热议问题