Skip to content

How to get PUT/POST/PATCH payload data? Details on the flow of res->onData(lambda) please. #1682

Answered by uNetworkingAB
ddevienne asked this question in Q&A
Discussion options

You must be logged in to vote

Req is stack allocated, Res is not. If you want to respond to a POST without doing any allocations (let's say you get all body in one go), you look at the headers and distill the information you need down to X, then you capture X in the onData lambda.

But you can also just attach a different lambda with different code based on your headers and URL, then you don't need any X to capture (more than you would either way)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@uNetworkingAB
Comment options

Answer selected by ddevienne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants