nategood / httpful

A Chainable, REST Friendly, PHP HTTP Client. A sane alternative to cURL.
MIT License
1.74k stars 298 forks source link

Allow curl to decode the response #297

Closed stfndamjanovic closed 1 year ago

stfndamjanovic commented 2 years ago

This PR is trying to fix the issue with a compressed response, in my case, it was "gzip" compression. For example, if we get "Content-Encoding: gzip" from the server side we will get the exception with the message "Unable to parse the response as JSON: Control character error, possibly incorrectly encoded"

The point is to allow curl to decode the response automatically if it is compressed and then later every parser can continue to do their jobs without any issue.

Please let me know what do you think.

Thanks!

stfndamjanovic commented 2 years ago

Hey @nategood, this PR is related to issue #171