views:

70

answers:

2

After WebBrowser.Navigate() how to retreive response headers returned by server ?

+1  A: 

I don't think that's possible. A web page is made up of many HTTP requests and responses. You'd have to download the HTML yourself with HttpWebRequest. Its Headers property gives you access to the response headers.

Hans Passant
I mean for a specific request with known URL, not for the whole page which may fetch other resources and make new requests as you mentioned.
Xaqron
@Xaqron: HttpWebRequest won't interpret the HTML (if any) and do numerous requests. It will only do the HTTP request against that one known URL.
Tamás Szelei
Xaqron
+1  A: 

You can register a temporary pluggable namespace handler for the http protocol to record the conversations with the server so you can look up them when you need to. See http://google-gears.googlecode.com/svn/trunk/gears/localserver/ie/http_handler_ie.cc and http://www.codeproject.com/KB/miscctrl/csEXWB.aspx for examples.

Sheng Jiang 蒋晟
Thanks for your time but I need a small, pure .NET solution.
Xaqron