Skip to content

ararog/deboa

deboa

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.0.9", features = ["http1", "http2", "tokio-rt"] }

Runtimes

Crate features

  • tokio-rt (default)
  • smol-rt
  • http1 (default)
  • http2 (default)
  • http3 (tokio only)

Usage

use deboa::{Client, errors::DeboaError, request::get, Result};
use deboa_extras::http::serde::json::JsonBody;

#[tokio::main]
async fn main() -> Result<()> {
  // Create a new Client instance, set timeouts, catches and protocol.
  let mut client = Client::new();

  let posts: Vec<Post> = get("https://jsonplaceholder.typicode.com/posts")?
    .header(header::CONTENT_TYPE, "application/json")
    .send_with(&mut client)
    .await?
    .body_as(JsonBody)
    .await?;

  println!("posts: {:#?}", posts);

  Ok(())
}

Subprojects

The core create of http client.

deboa-bora (removed)

A crate with bora macro, for easy rest client generation. Bora macro is now part of vamo-macros.

Pluggable compression/decompression, serializers, sse, websockets and catchers. All of them are optional. This is the place to contribute with your own pluggable features.

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.

A crate with testing utilities to be used with deboa and other crates.

Nice wrapper on top of deboa for dry rest client. Set base url once and use it for all requests.

Vamo macros is a collection of macros to make possible use structs as resources to be sent over vamo as client. It is also the new home of bora macro.

License

MIT

Author

Rogerio Pereira Araujo rogerio.araujo@gmail.com

Sponsor this project

 

Packages

No packages published