Let's say I have a Sinatra ala route:
put '/data' do
request.body.read
end
It seems that the entire request.body is being read into memory. Is there a way to consume the body when it enters the system, instead of pre-fueling it in Rack / Sinatra?
I see that I can do this to read the body in parts, but the whole body still seems to be read in memory in advance.
put '/data' do
while request.body.read(1024) != nil
end
end
source
share