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
4,261 downloads per month
Used in 8 crates
(7 directly)
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