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

#1113 in Network programming

Download history 1185/week @ 2024-11-15 1212/week @ 2024-11-22 1212/week @ 2024-11-29 834/week @ 2024-12-06 1011/week @ 2024-12-13 449/week @ 2024-12-20 756/week @ 2024-12-27 1493/week @ 2025-01-03 1092/week @ 2025-01-10 441/week @ 2025-01-17 402/week @ 2025-01-24 656/week @ 2025-01-31 817/week @ 2025-02-07 878/week @ 2025-02-14 556/week @ 2025-02-21 653/week @ 2025-02-28

3,181 downloads per month
Used in opentalk-client-shared

MIT/Apache

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
~172K SLoC