Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capture HTTP requests with Javascript

is it possible with javascript to listen for and capture outgoing HTTP requests? (For example, AJAX calls). Sort of like firebug, etc

like image 441
Andy Hin Avatar asked Feb 03 '23 23:02

Andy Hin


1 Answers

Nope, not like firebug. The closest thing you can do, if you're using a framework such as jQuery or Microsoft AJAX.NET, you can be notified when an AJAX request is issued through that specific framework.

For jQuery, that's .ajaxStart()

There are heaps of requests that this won't catch, though, such as all requested assets (script files, images, etc.)

like image 56
David Hedlund Avatar answered Feb 05 '23 11:02

David Hedlund