Home > Enterprise >  Angular, how understand which point of the code sent a specific http request
Angular, how understand which point of the code sent a specific http request

Time:02-17

as in the attach screenshot I have a complex Angular application which I see now for the first time; from a specific page, in the Chrome Dev Tools -> 'Network' tab I see a list of http call (see the red arrow). I should edit a specific HTTP GET call, in order to change some params.

The question is: how can I see which file / component / service sent a particular HTTP GET call and which line of code? Is something like that in the Chrome Dev Tools?

Thank you very much

enter image description here

CodePudding user response:

Are you allowed to access the source code of web application? Modern IDE's or text editor (e.g: VSCode) allow us to search by a keywork. In Google Chrome, you can go to initiator tab and see the request call track: Request call track example from google chrome.

CodePudding user response:

You really can't tell from the network traffic or Fiddler where calls are originating from.

One thing you can try is to make your network calls unique by adding an unused parameter to the url. Something like this:

https://my-app/api/getSomething/25?originator=hello-world

But if you do this, you may have to adjust your service routes to ignore the query string parameter. It depends on how you're implementing the backend.

  • Related