6 releases
0.3.2 | Sep 20, 2024 |
---|---|
0.3.1 | Sep 13, 2024 |
0.2.0 | May 14, 2024 |
0.1.2 | Feb 23, 2024 |
#496 in Network programming
9,408 downloads per month
Used in 9 crates
(2 directly)
27KB
424 lines
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
.
lib.rs
:
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 {}
Dependencies
~3–14MB
~169K SLoC