egg-mode-rs / egg-mode

a twitter api crate for rust
https://crates.io/crates/egg-mode
Mozilla Public License 2.0
372 stars 65 forks source link

Add `Accept-Encoding` when making API requests #122

Open tesaguri opened 3 years ago

tesaguri commented 3 years ago

This uses tower-http crate's Decompression middleware, which adds Accept-Encodings to the requests and transparently decodes the response bodies. It should significantly reduce network traffic.

The REST API supports the efficient br encoding but the Streaming API v1 supports the gzip encoding only, so I enabled both the encodings.

tesaguri commented 2 years ago

Upgraded tower-http to ^0.3.

The CI failure seems to be due to a dependency's MSRV bump and not to be related to this change.