I'm looking to make a URL's response only accessible through an HTTP request through JavaScript XHR / Jquery Ajax / Node Axios / Curl / whatever, you get it. For example, say you make a RESTful API request to a given URL endpoint. I want this given endpoint to only be accessible through an HTTP request through code only. Another words, I don't want people to access the URL's content via browser.
If the API expects for example a custom header (X-Called-By=not a browser) then it is unlikely that someone will accidentally navigate to that content using a browser.
However, this doesn't add to the security of the system. If you want to protect the API from unintended users, then use authentication and authorization.