reqwest README

The project's README from github.com/seanmonstar/reqwest. As one markdown file: README.md.

reqwest

crates.io Documentation MIT/Apache-2 licensed CI

An ergonomic, batteries-included HTTP Client for Rust.

Example

This asynchronous example uses Tokio and enables some optional features, so your Cargo.toml could look like this:

[dependencies]
reqwest = { version = "0.13", features = ["json"] }
tokio = { version = "1", features = ["full"] }

And then the code:

use std::collections::HashMap;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let resp = reqwest::get("https://httpbin.org/ip")
        .await?
        .json::<HashMap<String, String>>()
        .await?;
    println!("{resp:#?}");
    Ok(())
}

Commercial Support

For private advice, support, reviews, access to the maintainer, and the like, reach out for commercial support.

Requirements

By default, Reqwest uses rustls, but when the native-tls feature is enabled it will use the operating system TLS framework if available, meaning Windows and macOS. On Linux, it will use the available OpenSSL (see https://docs.rs/openssl for supported versions and more details) or fail to build if not found. Alternatively you can enable the native-tls-vendored feature to compile a copy of OpenSSL.

License

Licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Sponsors

Support this project by becoming a sponsor.

reqwest (seanmonstar/reqwest)

Searching Database…

11.9K ·GitHub
What is this?Reqwest is an easy and powerful HTTP client library for Rust — ergonomic and batteries-included, so the common things an HTTP client needs work out of the box.
Is it a library I call from my Rust code, or a standalone tool I run?It's a Rust crate: you add it as a dependency of your own project and call it in code — there is no executable to install or run on its own.
How do I start making requests with it?Add reqwest to your Cargo.toml, enabling the optional features you need, then send requests — asynchronously on Tokio, or through the built-in blocking client if you'd rather avoid async.
Do I need to bring anything else, like Tokio or a TLS stack?The async API runs on Tokio. For HTTPS, reqwest uses rustls by default, so no system TLS setup is required; the native-tls feature switches to the OS TLS framework on Windows and macOS.
Are there any build pitfalls I should know about?With native-tls on Linux, reqwest links the system OpenSSL and the build fails if it isn't installed; the native-tls-vendored feature works around this by compiling a copy of OpenSSL.
What does it cover out of the box beyond plain requests?Plain bodies, JSON, urlencoded forms and multipart uploads, a cookie store, HTTP proxies, a customizable redirect policy, and HTTPS are all built in — plus your choice of async or blocking clients.
Can it run in the browser?Yes — WASM is a supported target, so you can compile reqwest to WebAssembly and use the same client API from web pages.
Is there paid support if I need help beyond GitHub issues?Yes — the author offers commercial support for private advice, reviews and direct access to the maintainer through the sponsor link in the README.
What are similar projects?request, got, guzzle, hyper, actix-web, aiohttp, cpp-httplib, pingora
Size
2.8 MB
Stars
11.9K
Age
10y
Commits · 90 Days