[GH-ISSUE #527] Add reqwest-middleware support #170

Closed
opened 2026-02-27 20:23:32 +03:00 by kerem · 2 comments
Owner

Originally created by @lazulit3 on GitHub (Jun 11, 2025).
Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/527

Is your feature request related to a problem? Please describe.
I would like to use reqwest-middleware with rspotify's reqwest client so that I can use http-cache-reqwest to cache my API responses.

Describe the solution you'd like
Could we expand rspotify-http to support reqwest-middleware?

I suspect we could gate middleware support behind a feature flag.

Describe alternatives you've considered

Additional context
Supporting middleware on the reqwest client could be useful in many ways, but the big one is this would satisfy an option for caching API requests from Spotify (leveraging ETags). Related to:

Originally created by @lazulit3 on GitHub (Jun 11, 2025). Original GitHub issue: https://github.com/ramsayleung/rspotify/issues/527 **Is your feature request related to a problem? Please describe.** I would like to use [`reqwest-middleware`](https://crates.io/crates/reqwest-middleware) with rspotify's reqwest client so that I can use [`http-cache-reqwest`](https://crates.io/crates/http-cache-reqwest) to cache my API responses. **Describe the solution you'd like** Could we expand `rspotify-http` to support `reqwest-middleware`? I suspect we could gate middleware support behind a feature flag. **Describe alternatives you've considered** - Due to `rspotify`'s design (supporting varying HTTP clients), it does not appear possible to bring one's own HTTP client (e.g. `pub(crate) http: HttpClient,`) - I am using a fork of `rspotify` as a workaround, but would prefer to depend on upstream: https://github.com/lazulit3/rspotify/tree/feat-reqwest-middleware **Additional context** Supporting middleware on the `reqwest` client could be useful in many ways, but the big one is this would satisfy an option for caching API requests from Spotify (leveraging ETags). Related to: - https://github.com/ramsayleung/rspotify/issues/6
kerem 2026-02-27 20:23:32 +03:00
Author
Owner

@lazulit3 commented on GitHub (Jun 11, 2025):

I've opened a PR with some WIP towards this that I'd like to share.

It probably needs more testing/docs/examples, and I would super appreciate help getting it over the finish line. Love y'all <3

<!-- gh-comment-id:2963372557 --> @lazulit3 commented on GitHub (Jun 11, 2025): I've opened a PR with some WIP towards this that I'd like to share. It probably needs more testing/docs/examples, and I would super appreciate help getting it over the finish line. Love y'all <3 - https://github.com/ramsayleung/rspotify/pull/528
Author
Owner

@ramsayleung commented on GitHub (Jul 7, 2025):

Closing this issue as the PR #528 has been merged.

<!-- gh-comment-id:3043324857 --> @ramsayleung commented on GitHub (Jul 7, 2025): Closing this issue as the PR #528 has been merged.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#170
No description provided.