API Reference
Reqwest
Ergonomic and async HTTP client for Rust with TLS, JSON, and streaming support.
Official Documentation ↗CompatibilityThis documentation covers version
v0.12. Check the official docs for the latest API surface.Installation
cargo
cargo add reqwestMethods
No methods match this filter.
Reqwest is an ergonomic and async HTTP client for Rust. It builds on the hyper and Tokio ecosystems to provide a simple API for making requests with TLS, JSON, cookies, and streaming.
Key Features
- Async: Built on Tokio and hyper
- TLS: rustls or native-tls via features
- JSON: Serde-powered serialization and parsing
- Streaming: Chunked and streamed bodies
- Pooling: Reusable Client with keep-alive
Errors
The following points are quoted verbatim from the official documentation. 来源:https://docs.rs/reqwest/ · 取证方式:HTTP GET 官方 README/文档页(HTML 去标签) · 抓取时间:2026-11-07T13:52:07.123Z. Any error type, throw condition or recovery step not stated there is left unspecified; this page does not infer exception classes or return values.
- Type Aliases § Result A Result alias where the Err case is reqwest::Error . (https://docs.rs/reqwest/)
FAQ
- How do I enable TLS in reqwest?
- Enable the rustls-tls or native-tls feature in your Cargo.toml. rustls-tls is pure Rust and portable; native-tls uses the platform TLS stack. Without a TLS feature, HTTPS requests will fail at compile time.
- How do I retry failed requests?
- Reqwest does not retry automatically. Wrap calls in a loop with backoff, or use a retry middleware crate like reqwest-retry. Check response.status().is_server_error() to decide whether to retry.
- Can reqwest run in a sync context?
- Yes, with the blocking feature, which provides reqwest::blocking::get and Client. This runs on an internal runtime, so you cannot mix it with async Tokio code in the same thread.
Report a problem with this API docOpens a pre-filled issue on GitHub.