HTTP Response from web browser
I'm trying to get the HTTP Response header out of a WebBrowser control so I can figure out what type of document it is, specifically RSS versus HTML.
I tried using WebBrowser.DocumentType, but the return value of that seems dependent on your default program settings (as HTML documents show up as "Firefox Document" for me), and I also do not want to just assume that all "XML Document"s are RSS feeds.
I also tried using the XML parser to parse the document to see if the root tag was <html> or <rss> but the "DocumentText" and "DocumentStream" properties return the formatted data, which is a HTML document regardless because of the way IE formats XML documents.
Lastly, I tried manually using a HttpWebRequest object to download the response manually, and then copying the response stream in to the "DocumentText" property, but the browser was still on "about:blank" so that screwed up all of the relative linking on sites.
The only other thing I can think of is to send a http "head" request to get the response header before navigating with the web browser, but it seems like that causes unnecessary network traffic.