seanmonstar / reqwest

An easy and powerful Rust HTTP Client
https://docs.rs/reqwest
Apache License 2.0
9.66k stars 1.09k forks source link

[Feature Request] add `tower::Service` implementation for `http::Request` and `http:: Response` types. #2251

Closed alekseysidorov closed 2 weeks ago

alekseysidorov commented 4 months ago

reqwest::Client already has tower::Service implementation for the reqwest::Request and reqwest::Response types. But it lacks of the service implementation for http::Request and http::Response types. If we add this implementation we can use a lot of existing layers from the tower_http crate without any code modification.

I already implemented this feature in my own crate. But I believe it would be better to add this functionality to the core library than to use adapters.

Here is my implementation.

avdb13 commented 3 months ago

Updates?

lcmgh commented 1 month ago

I am supporting this in order to not further fragment the middleware ecosystem.

alekseysidorov commented 1 month ago

I think that we can get a little closer to this goal if we merge this MR. It's just simplify interop with other Body implementations.