Skip to content

Remove http-client crate, suggest reqwest as a default client#9

Merged
simolus3 merged 7 commits intomainfrom
http-crate
Mar 16, 2026
Merged

Remove http-client crate, suggest reqwest as a default client#9
simolus3 merged 7 commits intomainfrom
http-crate

Conversation

@simolus3
Copy link
Collaborator

@simolus3 simolus3 commented Mar 16, 2026

Like all PowerSync SDKs, we need a way to send HTTP requests with streaming responses here. Previously, we've used the http-client crate as an interface for HTTP clients and relied on a libcurl wrapper as a default implementation.

While that generally worked pretty well, the http-client crate is not that actively maintained and most of the Rust ecosystem (also Tauri in particular) seems to use reqwest as a default client. We could implement the http-client trait via reqwest, but there are some downsides for that. In particular, reqwest represents response bodies as a Stream<Bytes> while http-client represents them as an AsyncBufRead. That's a gap that can be bridged, but since we kind of want to use whatever reqwest does by default, it's easier to just remove the http-client dependency and suggest reqwest instead.

To be able to use the SDK with custom clients, reqwest is an optional dependency and it's possible to implement custom http clients (I've introduced a trait exposing just the functionality needed by the SDK, that's also what we use for mocks in tests).

@simolus3 simolus3 requested a review from stevensJourney March 16, 2026 09:24
@simolus3 simolus3 merged commit df86223 into main Mar 16, 2026
2 checks passed
@simolus3 simolus3 deleted the http-crate branch March 16, 2026 15:25
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