I am having 401 Unauthorized error when sending get request. I am confused because I can send request over the terminal with curl or postman but not from the code (localhost)
CODE
const carId = '2F3A228F6F66AEA580'
var query = 'https://api.mercedes-benz.com/experimental/connectedvehicle/v1/vehicles/'.concat(carId).concat('/doors')
console.log(query)
console.log(this.state.access_token)
var bearer = 'Bearer ' + this.state.access_token
console.log(bearer)
const response = await fetch(query, {
method: 'GET',
headers: {
'accept': 'application/json',
'authorization': bearer
},
})
Note : I am using the same access_token