toland / patron

Ruby HTTP client based on libcurl
http://toland.github.com/patron/
MIT License
541 stars 73 forks source link

Allow the `data' argument to put() etc. to be a File #132

Closed julik closed 8 years ago

julik commented 8 years ago

Allow a simpler way to set a Ruby File object as data argument for performing uploads. This is majorly useful for endpoints that accept verbatim uploads without multipart wrapping. Next step is getting rid of the filename multi-args, but I think it is better to do in 2.0 once we can cut 1.0 because it will have us revamp APIs ;-)

julik commented 8 years ago

BTW I see that we currently set the transfer encoding to chunked when sending a file. Is it really necessary if we now (presumably) set the right Content-Length of the request body correctly by specifying the size of the request body from either string or file, upfront?

toland commented 8 years ago

Nice. 👍

I don't think chunked encoding is strictly necessary, but it has been a long time since I worked on that code.

julik commented 8 years ago

Awesome! Can you roll 0.7 please?

toland commented 8 years ago

Will do.

toland commented 8 years ago

Done.

julik commented 8 years ago

❤️