7 releases
0.1.8 | Feb 9, 2025 |
---|---|
0.1.7 | Feb 1, 2025 |
0.1.6 | Jan 28, 2025 |
#946 in Magic Beans
565 downloads per month
Used in 2 crates
18KB
281 lines
REST API
Usage
Register hook
fn init() {
let hooker = Hook::new();
rest_api::add_hook(hooker);
}
struct Hook {}
impl rest_api::RequestHooker for Hook {
fn before_request(&self, req: reqwest::RequestBuilder) -> reqwest::RequestBuilder {
req.header("Authorization", format!("Bearer token"))
}
}
Call API
- Below code will call
before_request
function
rest_api::get("http://localhost:3000/version");
Dependencies
~12–25MB
~452K SLoC