reqwest icon indicating copy to clipboard operation
reqwest copied to clipboard

Firefox doesn't set content type correctly if set in the headers object.

Open blainekasten opened this issue 10 years ago • 0 comments

Given the following code:

reqwest({
    url: '/test',
    method: 'PUT',
    data: JSON.stringify({obj: true}),
    headers: {
        'Content-Type': 'application/json'
    }
});

This properly sets the content-type in chrome. But not in firefox. Thus, the server will improperly parse the params. It works fine if I set the contentType: 'application/json'. So you should look at both locations to set the header.

blainekasten avatar Dec 04 '14 17:12 blainekasten