lostisland / faraday

Simple, but flexible HTTP client library, with support for multiple backends.
https://lostisland.github.io/faraday
MIT License
5.74k stars 976 forks source link

Faraday using PUT with Transfer-Encoding: chunked #1507

Closed dshorthouse closed 1 year ago

dshorthouse commented 1 year ago

Apologies in advance for the inquiry, but am not sure where else (or how else) to pose my inquiry. I make use of a OAuth2::Client with Faraday.default_adapter and am trying to figure out how to do a PUT with a chunked transfer encoding to stream a file to an endpoint. I can use File.read to put a file in memory and then PUT it in the body of a request, but this defeats the purpose. Is it possible to use Faraday in conjunction with OAuth2::Client to do such a thing? Is there perhaps some Faraday middleware module comparable to Faraday::Multipart::FilePart that would/could construct a chunked body for a large file to PUT? Thanks for any pointers.