reactphp / http

Event-driven, streaming HTTP client and server implementation for ReactPHP.
https://reactphp.org/http/
MIT License
746 stars 143 forks source link

HTTP client: Support compression (Content-Encoding: gzip) #377

Open clue opened 4 years ago

clue commented 4 years ago

This library should support requesting compressed responses and automatically decompress using the Accept-Encoding request header and Content-Encoding response header.

This should be an opt-in feature.

Implementing this for buffered requests shouldn't be too hard. This should make sure to also respect the withResponseBuffer() setting.

Implementing this for streaming requests is doable, see also https://github.com/clue/reactphp-zlib.

We welcome contributions, reach out if you want to support this project :+1:

maxgalbu commented 1 year ago

For buffered responses, it's as easy as doing gzdecode/gzdeflate(), or does it need async solutions?

WyriHaximus commented 1 year ago

IIRC you can decode streams in chunks, and either me or @clue might have the package for it lying around AFAIK

maxgalbu commented 1 year ago

How will this library change with reactphp v3? Will changes to this library still be accepted?

SimonFrings commented 1 year ago

How will this library change with reactphp v3

@maxgalbu You can read about our rough plans for each project and ReactPHP in whole in our discussion: https://github.com/orgs/reactphp/discussions/481 We will also release a more detailed roadmap for each repository in the next couple of weeks, to show the upcoming features and necessary steps towards the new major release, stay tuned.

Will changes to this library still be accepted?

While ReactPHP v3 will be the way forward, we are also committed to continue supporting the current v1 for a certain amount of time, if you have any ideas or want to contribute to the project, we're happy to take a look. In short: Yes, changes will be accepted :+1: