If you just need to know what the headers are, then try this

HttpWebRequest myHttpWebRequest =
(HttpWebRequest)WebRequest.Create("http://localhost/";);

HttpWebResponse myHttpWebResponse =
(HttpWebResponse)myHttpWebRequest.GetResponse();

for(int i=0; i < myHttpWebResponse.Headers.Count; ++i)
   Console.WriteLine("\nHeader Name:{0},
Value:{1}",myHttpWebResponse.Headers.Keys[i],myHttpWebResponse.Headers[i
]);

myHttpWebResponse.Close();

Deepak

> -----Original Message-----
> From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf
Of
> Tracy Martin
> Sent: Sunday, April 14, 2002 11:52 AM
> To: [EMAIL PROTECTED]
> Subject: [DOTNET] HttpWebReqponse - raw headers?
>
> Greetings,
>
> I'm playing with HttpWebRequest and HttpWebResponse, and I can't seem
> to find a way to get the raw header stream. I thought perhaps
> GetResponseStream, but that returns the actual internet resource, not
> the headers.
>
> I want to be able to log the raw headers for certain retrievals - and
> I'd rather not resort to having to write this using Sockets...
>
> Any ideas?
>
> Tracy
>
> You can read messages from the DOTNET archive, unsubscribe from
DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to