I want to build a API with Grape, which could be POST file through http streaming. How to do that?
PS grape example of rack-stream couldn't work
error info: HTTP/1.1 503 Service Unavailable
I want to build a API with Grape, which could be POST file through http streaming. How to do that?
PS grape example of rack-stream couldn't work
error info: HTTP/1.1 503 Service Unavailable
I want to make grape can handle request like this:
Net::HTTP.new('localhost', 9292).start do |h|
req = Net::HTTP::Post.new('/api/http_streaming_post')
File.open('binary_file.bin') do |f|
req.body_stream = f
req['Content-Length'] = f.lstat.size.to_s
req['Content-Type'] = 'text/html;charset=utf-8'
response = h.request req
end
end
I don't know how to do it.
After found reading body_stream in sinatra, I use sinatra instead.