Module reqwest
HTTP client for making web requests.
reqwest is a high-level HTTP client library built on top of hyper.
It provides both asynchronous and blocking APIs for making HTTP requests,
with support for JSON, form data, cookies, proxies, and TLS.
The async API uses Client as the main entry point.
For quick one-off requests, convenience functions like get are available.
The blocking API lives in the blocking module.
Common features include:
- Automatic handling of redirects and cookies
- JSON serialization/deserialization via serde
- Request timeouts and connection pooling
- TLS/HTTPS support via native-tls or rustls
- Multipart form data for file uploads
- Streaming request and response bodies
Examples
Making a simple GET request (blocking):
use blocking;
let body = get
.expect
.text
.expect;
println!;
Making an async GET request:
use Client;
async
Posting JSON data:
use Client;
use ;
async
Modules
Functions
-
get
Shortcut method to quickly make a
GETrequest.