简体   繁体   中英

Is it possible to log HTTP request client side with javascript?

Is it possible to log HTTP request client side with javascript? For instance going to some website-> opening the chrome console-> enter some javascript and console.log GET and POST URL's. Similar as the chrome network tab does. I have Googled but couldn't find anything that addresses this problem. Is this only possible server side?

If you're talking about the request for the current page, no, there's not much you can do client-side. You can get some information on AJAX requests from the XMLHttpRequest object, but not as thorough as the browser's developer tools.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM