Idiomatic REST API clients in Rust

#1

What are some of the best examples on how to use Rust to make a REST client for an existing REST API? It should be large enough to be production ready and not just a toy example. Also showing ways on how testing is dont is important?

Anyone have made some nice integrations or know of others out there?

1 Like

#2

github-rs is pretty well designed, and the author has blogged about how they ended up with that design.

0 Likes

#3

May be I missed something, but there is no way to use it in async way.
So current thread stops until the network reply, this is looks like huge anti-pattern for REST API client library.

0 Likes

#4

Depends on your use case, although I agree ideally it’d support both sync and async. It seems like github-rs was written before the Rust ecosystem had started to mature, and nobody has had time/reason to update it yet.

Still, I think the general gist of the blog post (using types/builders to make it impossible to build an invalid request) is still relevant today, whether you’re building an async client or not :slight_smile:

0 Likes