Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capturing all requests and responses from the web browser control?

Is there way to capture and print out all of the requests and responses from the web browser control including asynchronous requests?

like image 274
Kenneth J Avatar asked Aug 16 '10 15:08

Kenneth J


1 Answers

Have you thought about using Fiddler? They even have an API that you might be able to use for this.

Edit

You can try using the Navigated event or LoadCompleted event for getting response information. You might be able to use the Navigating event for request information. These events might occur with async requests, but I'm not sure on that.

The Edit Strikes Back

Well I did some testing using the above events, and I'm afraid I got nothing. The events were not giving me anything that I could use. Even though they had access to webresponse and webrequest, they were always nothing/null in my testing.

I guess the sad reality is that the web browser control was not intended to be used the way you want. It's just for serving web pages/data and does not provide you the access to look into the data. I think they did it as a C.Y.A. measure to prevent someone from making a malware/spyware browser.

Your best bet is going to be coupling the web browser with fiddler (or some other 'sniffing' library).

like image 186
Tony Abrams Avatar answered Sep 21 '22 12:09

Tony Abrams