puppetlabs / clj-http-client

HTTP client library wrapping Apache HttpAsyncClient
Apache License 2.0
15 stars 30 forks source link

(PDB-2640) Add option for gzip compressing a request's body #67

Closed camlow325 closed 7 years ago

camlow325 commented 7 years ago

This commit adds a new Clojure HTTP request option, :compress-request-body`, and corresponding Java option which can be used to have gzip compression applied to the request's body before it is sent along to the server.

puppetcla commented 7 years ago

CLA signed by all contributors.

jpinsonault commented 7 years ago

Looks like it needs a rebase

camlow325 commented 7 years ago

Thanks, @jpinsonault. I rebased this at 689db7c. The only conflict I had to resolve was around the cheshire dev dependency I had added, which conflicted with the upgrade to clj-parent dependencies done in #68.

camlow325 commented 7 years ago

@rlinehan or @scottyw - could at least one of you take a look at this one? Thanks!

scottyw commented 7 years ago

I spent many a happy hour with that trying to make that PipedXxxStream stuff work in unbuffered responses. It's a nightmare. What you've done looks pretty fine to me.

camlow325 commented 7 years ago

@scottyw Thanks very much for reviewing my code! Agree that the PipedXxxStream stuff is a nightmare to follow. 😏

I found one hole in my code related to how the input stream is closed when a gzip-compressed request has been completed. I addressed this in cb5de45. If someone could take a look at that, would be much appreciated. Thanks!