A
A
adelnorberg2018-09-12 03:49:55
Node.js
adelnorberg, 2018-09-12 03:49:55

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

1 answer(s)
D
Dmitry Alekseev, 2018-09-12
@Zatmil

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 question

Ask a Question

731 491 924 answers to any question