When the the Content-Type header of a request is set to application/json shouldn't the request data be converted to a JSON string using JSON.stringify?
Currently I'm sending my requests like this:
reqwest({
url: '/api/v1/user',
type: 'json',
method: 'post',
contentType: 'application/json',
processData: false,
data: JSON.stringify({
first_name: 'John',
last_name: 'Doe'
})
});
But it would be easier if I could do this:
reqwest({
url: '/api/v1/user',
type: 'json',
method: 'post',
contentType: 'application/json',
data: {
first_name: 'John',
last_name: 'Doe'
}
});