Go REST
О

Authentication failed

Олег Морозов over 3 years ago 4696 views 4 replies

Authentication failed

4 replies
О
Олег Морозов over 3 years ago

Width correct token

{message: Authentication failed}
message
:
Authentication failed

О
Олег Морозов over 3 years ago

With :-)

О
Олег Морозов over 3 years ago

const GOREST_PATH = 'https://gorest.co.in/public/v2/users';

const response = await fetch(GOREST_PATH, {
method: 'POST',
body: JSON.stringify({
name: document.getElementById('form-name').value.trim(),
email: document.getElementById('form-email').value.trim(),
gender: 'male',
status: 'active'
}),
headers: {
Autorization: 'Bearer 4ee68b02f484f112f47cf5134ea9465fa53d4a0e736c27d2237da509a40bdbe1',
'Content-Type': 'application/json',
}
})

Z
zeevy over 3 years ago

Please try this

const GOREST_PATH = 'https://gorest.co.in/public/v2/users?access-token=YOUR_TOKEN';

Your reply

Markdown supported