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

Compatibility with tower and http #1370

Open
XAMPPRocky opened this issue Oct 27, 2021 · 3 comments
Open

Compatibility with tower and http #1370

XAMPPRocky opened this issue Oct 27, 2021 · 3 comments

Comments

@XAMPPRocky
Copy link

Hello, the growing popularity of "Sans I/O" HTTP clients has brought some tension between reqwest and other HTTP client libraries including hyper, as currently reqwest does not implement tower::Service at all, and even if it did, reqwest currently uses its own Response type instead of http::Response, meaning that libraries like kube-rs cannot be used with reqwest at all.

It would be nice if reqwest could integrate with rest of the ecosystem, or at the very least provide a compatibility layer for people who want to use reqwest as the client for their tower services.

@jennydaman
Copy link

Client implements Service

#491 (comment)

@XAMPPRocky
Copy link
Author

@jennydaman Thanks for the update, but as I mention in the original post, reqwest still uses its own HTTP Request and Response types for the Service, so that means you can't use it with HTTP libraries like kube-rs because kube-rs's client looks like this.

Box<dyn tower::Service<http::Request, Response = http:Response>>

Where as currently reqwest is only implemented for tower::Service<reqwest::Request, Response = reqwest::Response> which means that functionally it's only generic over its own types, and still can't be used interchangeably in the wider ecosystem.

@shouya
Copy link
Contributor

shouya commented Dec 13, 2023

I was thinking about the same so I implemented #2060. You may give it a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants