Skip to content

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

Merged
merged 6 commits into from
Jul 4, 2019

Conversation

aesapronov
Copy link
Contributor

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

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
Copy link
Collaborator

@d-a-v d-a-v left a 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) ?

@aesapronov
Copy link
Contributor Author

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?

@d-a-v
Copy link
Collaborator

d-a-v commented Feb 5, 2018

If you commit the changes on your own repo, the PR will be updated accordingly.

…one line"

Allow to send POST with empty payload
Copy link
Collaborator

@earlephilhower earlephilhower left a 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

@earlephilhower earlephilhower added this to the 2.6.0 milestone Jan 25, 2019
@d-a-v d-a-v merged commit e81bb6f into esp8266:master Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants