Authorization in HTTP GET

I have several data requests that don’t use authorization request working well.
However I now need to make a request with some auth headers.

The CURL request
curl --location --request GET ‘https:…’
–header ‘clientId: …’
–header ‘Authorization: Basic …’

Works OK, even from a coffee shop
But in the data backend using these headers I receive an error

Http failure response for https://…: 0 Unknown Error. This could be a CORS issue - try configuring your server to allow requests

Any ideas?

1 Like

could you please share the link to your project with me in direct messages?
we’ll take a look at it, and see what can be done.

Hi @ACUTEC, this most likely is a CORS issue, when the requesting server doesn’t add necessary info into the response to allow the requests to be made from a browser.

In this case:

Hope this helps.

Hi @dmitry_nehaychik,

We use this API in a lot of places without having to set CORS origins or proxy the request?
It does work with the proxy, but rather slow.

Hi @ACUTEC, the thing with the CORS is that it is designed for security in browsers.

This API could work with no problem while being used on a server or in a CURL request in a terminal or being called while on a specific domain (allowed by the CORS policy), but it won’t work in a browser if it’s not specifically allowed by the server.