I’ve got a simple class in Sveltekit with a method which is performing a GET
request. The method is the following:
async getRecordDataByBarcode(url) {
const response = fetch(url, {
"Authorization": "Discogs token=XXXXXXXXXXXXXXXX",
"Content-Type": "application/json",
})
.then(response => response.json())
.then(json => console.log(json))
.catch(error => console.log(error));
}
the response I’m getting from this is:
{ message: 'You must authenticate to access this resource.' }
yet when I attempt the same request in a REST client I’m getting back a successful response:
what am i doing wrong?
Yes, I made sure the URLs are the same, I output it on a log message and copied/pasted it on the REST client, the same goes for the token.