-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Added possibility of sending POST with empty payload #4275
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
Conversation
Specification does not prohibit the sending of an empty POST requests. In this case "Content-Length: 0" should be set. See thread here: http://lists.w3.org/Archives/Public/ietf-http-wg/2010JulSep/0276.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not an HTTP expert. If content-length
must always be present, what about removing the if
statement and simply replace String(size)
by String(payload && size > 0? size: 0)
?
Yes, I'm also not an expert. But it not need to be an expert to agree with you. You suggestion is right. Do you make changes to the code or should I need to do this? |
If you commit the changes on your own repo, the PR will be updated accordingly. |
…one line" Allow to send POST with empty payload
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems minor and legal per my reading of the specs
Specification does not prohibit the sending of an empty POST requests. In this case "Content-Length: 0" should be set. See thread here: http://lists.w3.org/Archives/Public/ietf-http-wg/2010JulSep/0276.html