influxdb-rs/influxdb-rust

Passthrough gzip param to http crate

NiwakaDev opened this issue · 2 comments

According to Use gzip compression, influxdb supports gzip compression. I think that influxdb-rust should support this.

//...
let enable_gzip = true;
let client = Client::new("http://localhost:8086", "test", enable_gzip);
//...

I guess that we can use flate2-rs to implement this feature.

If you agree with this feature, I'd like to implement this.

msrd0 commented

We give you the choice of using reqwest or surf as the HTTP client. I know that reqwest supports gzip encoding, and I'd assume surf also supports it. Either way, there's absolutely no need to implement gzip in this crate. The most we could do is pass through the gzip feature to the respective HTTP client, as at least reqwest requires a feature for gzip to be enabled.

I have adapted the issue title. Like @msrd0 said, it makes the most sense to include a toggle in the crate that enables gzip in the underlying http crate used.