nestrs-http
Outbound HTTP client for the nestrs framework — the Rust equivalent of @nestjs/axios.
use ;
;
async
What you get
HttpModule::register()— installs a singletonHttpServiceprovider.HttpService— wraps a sharedreqwest::Clientwith sane default timeouts (30s whole-request, 10s connect)..get(url),.post(url),.put(url),.patch(url),.delete(url)returnreqwest::RequestBuilders;.client()exposes the raw client for advanced use.HttpServiceOptions—request_timeout/connect_timeoutbuilder.DEFAULT_REQUEST_TIMEOUT/DEFAULT_CONNECT_TIMEOUT— the docs / tests can assert these.reqwestre-exported at the crate root under feature flagreqwestso callers don't add a direct dep.
Why
reqwest has no default timeout. Without an outbound deadline, a TCP-connected but unresponsive upstream hangs the calling handler's future forever and concurrent hung calls accumulate until the runtime is saturated. HttpService enforces a 30s / 10s default — tunable per-deployment via HttpServiceOptions.
Feature flags
default = []— base crate.reqwest— re-exportsreqwestat the crate root.
License
MIT OR Apache-2.0.