Answer the question
In order to leave comments, you need to log in
How to make a GET request with authorization?
Guys, I started writing a server on express + mongodb and ran into a problem from ignorance, I can’t make a get request on the server on someone else’s api where authorization is required (https protocol). How to make this request? Point, please, at least in the right direction. Surfed on the network, did not find it :(
Answer the question
In order to leave comments, you need to log in
Why can't you do it? What's the error? How is API authorization performed?
I can assume that the problem may be in CORS, since the request is for someone else's API.
If the headers of a foreign API, nevertheless, allow you to make cross-domain requests, then an authorized request may look like this, if, of course, we are talking about http authorization -
(http|https)://username:[email protected]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question