lasselukkari / aWOT

Arduino web server library.
MIT License
292 stars 42 forks source link

Cant get request body because Request.body() is missing. #65

Closed jvoj closed 4 years ago

jvoj commented 4 years ago

Hi, in api 1.x there is a function of Request.body() which is used in example here. But .body() function was removed by this commit "in favor of functions inherited from Stream".

Can you please create example or update docs to reflect stream api? I am struggling to find solution without the docs.

Thanks for your great work! :)

lasselukkari commented 4 years ago

Thanks for reminding. I have not published the a new version for a while and the docs reflect the last published version. These api changes are breaking and will require a major version to be bumped. All help with updating the docs is greatly appreciated. The docs are located in the gh-pages branch.

The replacement for body is readBytes: https://www.arduino.cc/reference/en/language/functions/communication/stream/streamreadbytes/

You can also use all the other stream functions with the request

Also check the tests: https://github.com/lasselukkari/aWOT/blob/master/test/stream.cpp