I am doing something like this:
var httpWebRequest = WebRequest.Create(context.Url) as HttpWebRequest;
httpWebRequest.Method = "POST"
... (set all the stuff)
... (get request stream and post data)
var httpWebResponse = httpWebRequest.GetResponse() as HttpWebResponse;
... (Inspect Headers)
var responseStream = httpWebRequest.GetResponseStream();
According to my modest expectations, I thought that the call to GetResponse () would only retrieve the headers, and the body would be loaded when I started reading from the response stream. What actually happens is that when I call GetResponseStream () and read it, the data is already available. The answer is a regular HTML page. I believe that using data with channels it works well.
So my question is: what really happens there and how to get only the headers from the http message before receiving the body content?
source
share