Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Don't stringify if there is not a body. #20

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants

tellnes commented Sep 11, 2013

Example:

request({ uri: 'some uri', json: true }, callback)

This will actually call JSON.stringify on null which results in the
string 'null'.

@tellnes tellnes Don't stringify if there is not a body.
Example:
```js
request({ uri: 'some uri', json: true }, callback)
```

This will actually call `JSON.stringify` on `null` which results in the
string `'null'`.
a313e3a

Turbo87 commented Dec 5, 2013

@jhs any chance of merging this soon? We just ran into quite some trouble due to this bug. The node.js request library is not sending any body if it is null, but replacing it with browser-request suddenly introduced this difference.

We are running a server with HttpCore that actually failed with HTTP 501 Not Implemented because it received a DELETE request with a request body that was 'null'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment