0

I already have an html page that includes a number of Javascript files. Let's assume that these JS files send HTTP requests using AJAX. I want to add a new Javascript file (without changing any existing JS files). This file will have to act as some kind of Event Listener. It will have to "listen" for an HTTP request (let's say GET, but it doesn't really matter) that will be sent by the web page, and once it "monitors" such a request, it will print the query of the request to console.

For example,

function listen_to_get_request(params, function callback(req) { 
    console.log(req.query);
}

I also read this post: Client-side detection of HTTP request method

and unfortunately it doesn't provide me any code that takes care of this issue.

Community
  • 1
  • 1
CrazySynthax
  • 13,662
  • 34
  • 99
  • 183

0 Answers0