Go REST
N

why there 400 bad request for POST method

nikita bais over 3 years ago 3817 views 4 replies

why there 400 bad request for POST method

4 replies
Z
zeevy over 3 years ago

some one can help, if you can share your code

N
nikita bais over 3 years ago

thanks for your message @zeevy.
I was trying to hit POST request in Rest console
{
email: lilly@test.net,
name: Lilly,
gender: Female,
status: Active,
}
getting code as 400,data : null

N
nikita bais over 3 years ago

now working in rest console
but there is error 401 Aauthentication failed for below code
const data = {
name: Lilly1,
email: lilly1@test.net,

gender: Female,
status: Active,
};
return request
.post('users')
.set('Authorization','Bearer ${TOKEN}')
.send(data).then((res) => {
console.log(res.body);

    });
N
nikita bais over 3 years ago

Now,It is working both in rest console and node.js code.Thanks

Your reply

Markdown supported