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: read-only clients #2160

Open
davepacheco opened this issue Mar 6, 2024 · 1 comment
Open

feature: read-only clients #2160

davepacheco opened this issue Mar 6, 2024 · 1 comment

Comments

@davepacheco
Copy link

It would be very handy to be able to create a reqwest client that could only make "read" requests (e.g., GET or HEAD). I imagine we could use Method::is_safe() for this?

This would allow applications to more safely implement "dry run" or "debug-only" clients that couldn't accidentally do something destructive to the server.

@seanmonstar
Copy link
Owner

The use case sounds cool!

Though, I'm leaning more towards an implementation not being something directly in reqwest, but rather a Middleware. That combined with my goal of making reqwest integrate with Tower would mean anyone could get that behavior wrapped around any stacked client.

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

2 participants