I was wondering what the possability was of changing these lines:
body = request.raw_post
data = ActiveSupport::JSON.decode(body)
to instead be handed the env['rack.input'] IO itself?
Being as though both calls (from_xml and decode) are handled by rails
elsewhere, we could move the responsibility of parsing of the request
body IO to the swappable XML/JSON backends.
I'm asking because I'm looking to integrate yajl-ruby as one of the
JSON backends for ActiveSupport in Rails 3. It's capable of parsing
JSON right off the IO as a stream, and this change would allow it to
perform it's best (and keep memory usage very low for large request
As for doing it for the XML backends as well, it opens up the
possibility of doing the type of stream parsing for XML.