onyxframework / http

An opinionated framework for scalable web 🌎
https://onyxframework.com/http
MIT License
143 stars 11 forks source link

Preserve body on certain params parsing #77

Closed vladfaust closed 5 years ago

vladfaust commented 5 years ago

The API could look like this:

json require: true, preserve_body: true do
  # ...
end

def call
  context.request.body.gets_to_end # Actual content
end

It would imply copying the body into separate IO, which would, of course, affect the performance. Moreover, it would be impossible to do request body streaming for obvious reason :thinking:

Thanks @qszhu for the proposal.