Add echo_async_server example #862
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds example code that implements a minimal echo server demonstrating how to read body data from the
connection
object associated with a POST request. It also contains information on how to deal with a "Expect: 100-continue" header which might be less known to users of the library.I think the code helps people who expect the body of a POST request is in
request.body
, which is obviously not the case, and getting started with asynchronous I/O. There is also a StackOverflow threat that addresses the issue and which has no accepted answer as of today (the proposed solutions go in the right direction but are not satisfying in my opinion).