Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
alekseysidorov opened this issue Apr 19, 2024 · 3 comments · Fixed by #2356
Labels
E-pr-welcome The feature is welcome to be added, instruction should be found in the issue.

Comments

@alekseysidorov
Copy link
Contributor

alekseysidorov commented Apr 19, 2024

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.

@alekseysidorov alekseysidorov changed the title [Feature Request] impl<S, ReqBody> tower::Service<http::Request<ReqBody>> for reqwest::Client [Feature Request] add tower::Service implementation for http::Request and http:: Response types. Apr 19, 2024
@avdb13
Copy link

avdb13 commented May 23, 2024

Updates?

@lcmgh
Copy link

lcmgh commented Jul 15, 2024

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

@seanmonstar seanmonstar added the E-pr-welcome The feature is welcome to be added, instruction should be found in the issue. label Jul 15, 2024
@alekseysidorov
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-pr-welcome The feature is welcome to be added, instruction should be found in the issue.
Projects
None yet
4 participants