Open droundy opened 6 years ago
This is especially annoying for me when trying to write a PATCH
endpoint that can accept data in different formats. Ideally I'd like to be able to just try a bunch of post_input!
calls in a row and accept the first one that matches the input.
Another motivation for this is to implement Digest header validation, which is required for HTTP request signing. It's necessary to be able to buffer the request body in memory and calculate its hash before handing it off to the actual request handler.
I found it confusing that the body is consumed when it is accessed, which means that after a
post_input!
fails there is no way to see what the form input was, and if I access the form input beforepost_input!
, then the latter fails.I would love to just see the body stored in memory, or perhaps cached in memory, although I guess there exist massive posts that this would cause trouble for... but something more friendly would be lovely. I'd also like to be able to call
post_input!
twice on the same request.