Closed ainar-g closed 5 years ago
Do you need to explicitly use chunked encoding? Can you give me a better idea of what you are trying to do?
Basically, I want to upload Rails's Tempfile
into a third-party server without reading the whole file into RAM. Right now I am using body_stream
from the native Net::HTTP
.
You can use https://github.com/socketry/protocol-http/blob/master/lib/protocol/http/body/file.rb or implement something similar. It should stream in chunks.
I couldn't quite figure out how to do that.
Async::HTTP::Body::Chunked
seems to be used in reading a chunked response, not sending it to a remote server. It would be nice to have an example.