3 Replies - 4651 Views - Last Post: 21 December 2010 - 04:15 PM Rate Topic: -----

#1 CodeFather  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 07-March 10

Retrieve http request generated by web browser control in .net

Posted 19 December 2010 - 12:22 PM

Hi.

How can i retrieve the HTTP Request generated by the web browser control in .net (3.5). When the user navigates to an html page it may contain images, for every image the web browser control needs to make a HTTP Request. I want to display all HTTP Requests made by the web browser control.
Does the web browser control use the httpWebRequest / httpWebResponse Classes internally? if so how can i access these objects?

thanks.!

Is This A Good Question/Topic? 0
  • +

Replies To: Retrieve http request generated by web browser control in .net

#2 Amrykid  Icon User is offline

  • 4+1=Moo
  • member icon

Reputation: 147
  • View blog
  • Posts: 1,589
  • Joined: 16-December 08

Re: Retrieve http request generated by web browser control in .net

Posted 20 December 2010 - 03:32 PM

The WebBrowser makes http request, but not using the HttpWebRequest classes. It's a long story.

A few ideas come to mind that you can try.
  • Make a small proxy and that redirects http data (which allows you to intercept the http data). (Recommended).
  • Use the HTTPWebRequest yourself.
  • Use the StatusChanged event and parse the status to find whats being downloaded. (Least Efficient)

Was This Post Helpful? 0
  • +
  • -

#3 CodeFather  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 36
  • Joined: 07-March 10

Re: Retrieve http request generated by web browser control in .net

Posted 21 December 2010 - 10:19 AM

View PostAmrykid, on 20 December 2010 - 02:32 PM, said:

The WebBrowser makes http request, but not using the HttpWebRequest classes. It's a long story.

A few ideas come to mind that you can try.
  • Make a small proxy and that redirects http data (which allows you to intercept the http data). (Recommended).
  • Use the HTTPWebRequest yourself.
  • Use the StatusChanged event and parse the status to find whats being downloaded. (Least Efficient)

thanks for the reply.
At the end of the day* I used the liveHttpHeader plugin for firefox (i just needed to demonstrate how http protocol works) i couldn't find a solution in .net on time (one of the few rare occasions where .net disappoints). Installing a IAT hook on WSASend and WSARecieve functions of WSOCK32.dll would have done the trick but why go through so much trouble for a little thing.
thanks!
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 5951
  • View blog
  • Posts: 23,210
  • Joined: 23-August 08

Re: Retrieve http request generated by web browser control in .net

Posted 21 December 2010 - 04:15 PM

Another option for this is Fiddler2, which is just the sort of proxy of which Amrykid spoke.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1