-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http body dropped when using delete method #19179
Comments
http spec says that while sending a body with DELETE is not forbidden (e.g. not a client error), a server should ignore it section 4.3: "if the request method does not include defined semantics for an entity-body, then the message-body SHOULD be ignored when handling the request" |
It's not a bug. As you've noticed, there's a property called The fact that |
I'll close this up as the question has been answered and there are no changes to be made. |
From what I can find, due to this line of code if you make an http request with a delete method the body will not be written (although no error will fire):
node/lib/_http_client.js
Line 141 in 4e15679
From what I can find the spec does not forbid and http body being placed (nor discourages) it (however it may not necessarily be a very commonly used). Here's a test case showing/recreating the issue:
FAILS:
A work around is to add
req.useChunkedEncodingByDefault = true
before write or end. e.g.,WORKAROUND:
Happy to submit a PR to see how i can help fix it, just wanted to make sure first there wasn't a disagreement as to whether delete should even have an option of having a body.
The text was updated successfully, but these errors were encountered: