Post Create User Always response 422 Unprocessable Content
I post this object {name
:Luis
, gender
:male
, email
:holasdasd@gmail.com
, status
:active
} and allways response [
{
field
: email
,
message
: can't be blank
},
{
field
: name
,
message
: can't be blank
},
{
field
: gender
,
message
: can't be blank, can be male of female
},
{
field
: status
,
message
: can't be blank
}
]
but i have send it,
please contact support go rest
cc: suport go rest
Can you please share your code, may be content header application/json is not set or your are not posting json object
This is my code obviusly replacing Bearer XXXXXXX to real token
const headers = {
'Accept':'application/json',
'Content-Type': 'aplication/json',
'Authorization': 'Bearer XXXXXXXXXXXXXXXXX'
}
export const postUsers = async (newUser: Usuario) => {
return await axios.post<any>( 'https://gorest.co.in/public/v2/users', newUser , {headers: headers});
}