Deboa
deboa (“fine” portuguese slang) 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.
Built on top of hyper.
Features
- easily add, remove and update headers
- helpers to add basic and bearer auth
- set retries and timeout
- pluggable catchers (interceptors)
- pluggable compression (gzip, deflate, brotli)
- pluggable serialization (json, xml, msgpack, yaml, fory and cbor)
- cookies support
- urlencoded and multipart forms
- comprehensive error handling
- response streaming
- upgrade support (websocket, etc.)
- runtime compatibility (tokio and smol)
- http1/2/3 support
Benchmark Results
As of the latest benchmark run, Deboa demonstrates competitive performance compared to Reqwest.
Get Request
Deboa |
Reqwest |
|
|---|---|---|
100 |
46.37 ms (✅ 1.00x) |
48.67 ms (✅ 1.05x slower) |
500 |
46.47 ms (✅ 1.00x) |
47.32 ms (✅ 1.02x slower) |
1000 |
46.36 ms (✅ 1.00x) |
47.34 ms (✅ 1.02x slower) |
Quick Start
Add to your Cargo.toml:
[dependencies]
deboa = { version = "0.0.9" }
deboa-tokio = { version = "0.1.0-beta.2" }
Basic usage:
use deboa::{
request::{DeboaRequest, FetchWith, get},
Result,
};
use deboa_tokio::Client;
use deboa_extras::http::{self, serde::json::JsonBody};
#[tokio::main]
async fn main() -> Result<()> {
// Create a new Client instance, set timeouts, catches and protocol.
let client = Client::new();
let posts: Vec<Post> = get("https://jsonplaceholder.typicode.com/posts")?
.header(header::CONTENT_TYPE, "application/json")
.send_with(&client)
.await?
.body_as(JsonBody)
.await?;
println!("posts: {:#?}", posts);
Ok(())
}
Crates
| Crate | Description | Documentation |
|---|---|---|
| deboa | Core HTTP client library | |
| deboa-smol | Smol runtime support for Deboa | |
| deboa-tokio | Tokio runtime support for Deboa | |
| deboa-extras | Additional functionality and middleware | |
| deboa-fory | Apache Fory support for Deboa | |
| deboa-macros | Procedural macros for Deboa | |
| vamo | DRY REST client wrapper | |
| vamo-macros | Macros for Vamo |
Examples
Check out the examples for complete examples of how to use Deboa in your projects.
Create project from template
You can create a new project from the template using cargo generate:
cargo generate ararog/deboa-templates
Documentation
Other Projects
- caramelo - Assertion based test framrwork
- easyhttpmock - HTTP mock server
- sofie - Fullstack web framework
- uget - CLI HTTP client
- vetis - Very Tiny Http server
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Author
Rogerio Pereira Araujo rogerio.araujo@gmail.com