I want to know if there is a way to identify is a HTTP request to a server is made through:
- the browser console
- JavaScript code running at client
I am able to make API calls to send like getJSON. Also I tried to make a Google Analytics call through the browser console.
Is there a way to find out if a request is made through the console, and if so can we block them at the server?
No. An HTTP request is an HTTP request, there is no way to tell what the source was.
(Also, “the browser console” is just a way to trigger “JavaScript code running at client”)