Hello Community,
Using client.js to access external REST API, I first have to get a “token” from the public server (“https://api.eurecia.com/eurecia/rest/v1/Auth”)
The request header must contain “authToken : myToken”
Code below:
var request = new Request('https://api.eurecia.com/eurecia/rest/v1/Auth', {
method: 'GET',
headers: new Headers({
'Content-Type': 'application/xml',
"authToken": euriciaAuth
})
});
fetch(request)
.then(res => {console.log(res)}
.then(error => {console.log(error)});
My request go througth the following error:
Thanks,