Skip to content

Conversation

@jgraef
Copy link
Owner

@jgraef jgraef commented Dec 16, 2025

This addresses #52

I've added traits Client and RequestBuilder that abstract over the specific implementation of a client and request builder - implemented by the corresponding reqwest and reqwest_middleware types.

We already has RequestBuilderExt, but it serves a different purpose. I renamed it to Upgrade, since that's the functionality it actually provides. I did think about this renaming in the past anyway, so this was a good time to do it.

The Upgrade extension trait will be implemented automatically for anything that is a RequestBuilder. It returns an Upgraded<R> where R: RequestBuilder that then is generic, but has all the information to perform the websocket upgrade.

All the middleware feature then has to do, is to implement the Client and ClientBuilder traits for reqwest_middleware::ClientWithMiddleware and reqwest_middleware::RequestBuilder respectively.

Because of the new traits and renamings, this will require a minor version bump.

There's one test for the middleware feature right now, but it doesn't work on wasm. The middleware feature does compile for wasm, but we should make sure it's actually usable.

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

Successfully merging this pull request may close these issues.

2 participants