deboa-0.0.1-alpha.1 has been yanked.
deboa
Description
deboa is a straightforward, non opinionated, developer-centric HTTP client library for Rust. It offers a rich array of modern features—from flexible authentication and serialization formats to runtime compatibility and middleware support—while maintaining simplicity and ease of use. It’s especially well-suited for Rust projects that require a lightweight, efficient HTTP client without sacrificing control or extensibility.
Attention
This release has a major api change. Please check the migration guide for more information.
Features
- easily add, remove and update headers
- helpers to add basic and bearer auth
- set base url only once, change it when needed
- request data only by specifying path
- set retries and timeout
- pluggable middleware
- pluggable compression (gzip, deflate, br)
- pluggable serialization (json, xml, msgpack)
- bora macro to easily create api clients
- cookies support
- comprehensive error handling
- runtime compatibility (tokio and smol)
- http1/2 support
Install
deboa =
Crate features
- tokio-rt (default)
- smol-rt
- http1 (default)
- http2
Usage
Serialize request and deserialize response using json
use Deboa;
use JsonBody;
let api = new;
let posts: = api.get.await?.body_as?;
println!;
Serialize request and deserialize response using xml
use Deboa;
use XmlBody;
let api = new;
let posts: = api.get.await?.body_as?;
println!;
Adding headers
use Deboa;
use header;
use JsonBody;
let mut api = new;
api.add_header;
let posts: = api.get.await?.body_as?;
println!;
Adding bearer auth
use Deboa;
use header;
let mut api = new;
api.add_bearer_auth;
let posts: = api.get.await?.body_as?;
println!;
Adding basic auth
use Deboa;
use header;
use JsonBody;
let mut api = new;
api.add_basic_auth;
let posts: = api.get.await?.body_as?;
println!;
Change request base url
use Deboa;
use JsonBody;
let mut api = new;
api.set_base_url;
let posts: = api.get.await?.body_as?;
println!;
Adding middleware
use ;
;
let mut api = new;
api.add_middleware;
let post: Post = api.get.await?.body_as?;
println!;
License
MIT
Author
Rogerio Pereira Araujo rogerio.araujo@gmail.com