Authentication failed

Authentication failed

Width correct token

{message: "Authentication failed"} message : "Authentication failed"

With :-)

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', } })

Please try this

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


Little markdown supported