Unleash / unleash-client-rust

Unleash client SDK for Rust language projects
Apache License 2.0
23 stars 17 forks source link

Support arbitrary HTTP clients #38

Closed rbtcollins closed 2 years ago

rbtcollins commented 2 years ago

Included: surf and reqwest.

Users can implement unleash_api_client::http::HttpClient to bring support for their own preferred client.

This permits only pulling in the relevant async ecosystem for the client being used, which may aide compile times for users of this crate.

rbtcollins commented 2 years ago

This looks great to my eyes! Currently it looks like while you could use another HTTP library, first class support is for Surf and Reqwest. It would be very cool if we could have an example with another HTTP client but that's low priority and should probably be done in another piece of work when we overhaul all the Unleash SDK examples

Adding a new http client is a relatively uncommon thing; there are pointers in the docs now, and the trait has its own API docs, so that should be sufficient to let folk discover and use it. But if folk get stuck/don't realise then that would be evidence that we should improve it.