Skip to content

Deboa

crates.io Build Status codecov Documentation

Description

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 using hyper.

Attention

This release has a major api change. Please check the migration guide for more information. Keep in mind API for prior to 0.1.0 is subject to change. Proper deprecation will be added in the next stable release.

Install

deboa = { version = "0.1.3" }

Runtimes

Usage

use deboa::{
    HttpClient,
    request::{DeboaRequest, FetchWith, get},
    Result,
};
use deboa_tokio::Client;
use deboa_extras::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(())
}

Subprojects

Top level project with runtime agnostic http client API.

A crate with collection of convenience macros for deboa. It is close equivalent to apisauce for axios, where one macro does it all, from request to response. It used to be the home of bora macro, which has been moved to vamo-macros crate.

deboa-compio (moved)

Deboa implementation for compio runtime to https://github.com/ararog/deboa-compio.

deboa-glommio (moved)

Deboa implementation for glommio runtime to https://github.com/ararog/deboa-glommio.

deboa-smol (moved)

Deboa implementation for smol runtime to https://github.com/ararog/deboa/deboa-smol.

deboa-tokio (moved)

Deboa implmentation for tokio runtime to https://github.com/ararog/deboa/deboa-tokio.

vamo (moved)

Vamo has moved to https://github.com/ararog/vamo.

vamo-macros (moved)

Vamo-macros has moved to https://github.com/ararog/vamo.

License

Licensed under either of

at your option.

Author

Rogerio Pereira Araujo rogerio.araujo@gmail.com

About

A very simple and straightforward HTTP client written in Rust.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

82 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages