9 releases (5 breaking)

Uses new Rust 2024

0.6.0 Apr 10, 2026
0.5.0 Jan 14, 2026
0.4.0 Apr 2, 2025
0.3.2 Sep 20, 2024
0.1.2 Feb 23, 2024

#1969 in Parser implementations

Download history 1767/week @ 2026-02-23 1746/week @ 2026-03-02 1744/week @ 2026-03-09 1557/week @ 2026-03-16 1700/week @ 2026-03-23 1619/week @ 2026-03-30 1732/week @ 2026-04-06 1644/week @ 2026-04-13 1626/week @ 2026-04-20 1469/week @ 2026-04-27 1579/week @ 2026-05-04 1536/week @ 2026-05-11 1480/week @ 2026-05-18 1532/week @ 2026-05-25 722/week @ 2026-06-01 323/week @ 2026-06-08

4,261 downloads per month
Used in 8 crates (7 directly)

MIT/Apache

24KB
409 lines

Attention: this crate is still under development.

You can derive HttpRequest on a struct and annotate it with some attributes, so that it can be used to build a http::Request which can then be sent to a server. In addition, a response type can be read from the received http::Response.

use http_request_derive::HttpRequest;
use serde::Deserialize;

#[derive(HttpRequest)]
#[http_request(method = "GET", response = MyResponse, path = "/books/{id}/abstract")]
struct MyRequest {
    #[http_request(query)]
    query: String,

    id: usize,
}

#[derive(Deserialize)]
struct MyResponse {}

http-request-derive rust library crate

Attention: this crate is still under development.

You can derive HttpRequest on a struct and annotate it with some attributes, so that it can be used to build a http::Request which can then be sent to a server. In addition, a response type can be read from the received http::Response.

Dependencies

~3–4.5MB
~78K SLoC