Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I view HTTP headers from a WebBrowser Control?

Status
Not open for further replies.

tlhawkins

Programmer
Joined
Dec 28, 2000
Messages
797
Location
US
Hey

I want to see what the HTTP headers are when my browser control is on a page. Is this possible with a WebBrowser control? Or is there another way?



Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
If you mean the contents of the page between the <HEAD> tags, could you not load the HTML of the page into an invisible text box and pull them from there?



jgjge3.gif
[tt]&quot;Very funny, Scotty... Now Beam down my clothes.&quot;[/tt]
 
If my above assumption is correct (Which it normally isn't, as my grandfather keeps telling me assumptions are dangerous).. Then try this code. (Created with a little help from VBDemiGod in thread222-702407)

Code:
    Dim mObj As Object
    Set mObj = WebBrowser1.Document.getElementsByTagName("HTML")
    Text1.Text = "<HTML>" & mObj(0).innerHTML & "</HTML>" 'will not return the tags themselves (HTML) but the nested markup for itself.
    Text1.Text = Mid(Text1.Text, InStr(1, Text1.Text, "<HEAD>") + 6, InStr(1, Text1.Text, "</HEAD>") - InStr(1, Text1.Text, "<HEAD>") - 7)

Hope it helps, if it doesn't, sod it (Grandfather again)



jgjge3.gif
[tt]&quot;Very funny, Scotty... Now Beam down my clothes.&quot;[/tt]
 
well, i hate to sod it but...

Thanks for the post... but that's not what I'm after. I mean the actual http headers. The entire response from the server, including the POST data, Cookie data,encoding types, and whever else happens to be in there. The browser gets that data... writes the cookies if it has to and then displays the HTML... where is the rest of the response?

Thanks,



Travis Hawkins
BeachBum Software
travis@cfm2asp.com
 
I think you might be interested in looking at the ResponseInfo property of the Internet Transfer COntrol (INet)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top