Skip to content
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

How to access raw POST request content #878

Closed
Diaoul opened this issue Oct 11, 2015 · 9 comments
Closed

How to access raw POST request content #878

Diaoul opened this issue Oct 11, 2015 · 9 comments

Comments

@Diaoul
Copy link
Contributor

Diaoul commented Oct 11, 2015

Sorry if this is a dumb question I couldn't find any mention of this in the docs or examples.
Using ESP8266WebServer, I want to process the raw content of an incoming POST request.

Is that possible?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@Duality4Y
Copy link
Contributor

How do you meen the raw content of the POST request ?

@Diaoul
Copy link
Contributor Author

Diaoul commented Oct 11, 2015

Well, the data POST, after the headers. I'm not using application/x-www-form-urlencoded but json.

@Diaoul
Copy link
Contributor Author

Diaoul commented Oct 11, 2015

After digging in the source code of the library I found the answer, raw content is considered as an argument named "plain".

I leave the issue open because this is quite unusual and should be documented somewhere.

@me-no-dev
Copy link
Collaborator

what do you think is the proper way to do it?

@Diaoul
Copy link
Contributor Author

Diaoul commented Oct 22, 2015

RFC defines the content of a request as the "message-body" (see https://tools.ietf.org/html/rfc7230#section-3)
I think "content" is also a good name and is used in the popular python library requests

@me-no-dev
Copy link
Collaborator

I vote for "messageBody" :) or just "body"

@marvinroger
Copy link
Contributor

I also vote for body, the message part is implicit. It is also a name used by popular libraries, like the request module in Node.js

@dave-prosee
Copy link
Contributor

Another vote for getting this documented. Thanks for posting the issue and your findings; it helped me.

@tinxx
Copy link

tinxx commented Jan 29, 2022

This issue can be closed. The documentation is available in the README.

arg - get request argument value, use arg("plain") to get POST body

@d-a-v d-a-v closed this as completed Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants