65 releases (36 stable)

Uses new Rust 2024

new 4.1.5 Mar 17, 2025
3.0.6 Mar 10, 2025
2.2.1 Feb 25, 2025
1.5.5 Jan 16, 2025
0.11.98 Jul 29, 2024

#14 in HTTP client

Download history 2259/week @ 2024-11-25 3844/week @ 2024-12-02 3432/week @ 2024-12-09 3892/week @ 2024-12-16 1761/week @ 2024-12-23 2666/week @ 2024-12-30 3329/week @ 2025-01-06 1934/week @ 2025-01-13 2365/week @ 2025-01-20 812/week @ 2025-01-27 1319/week @ 2025-02-03 2139/week @ 2025-02-10 3230/week @ 2025-02-17 2863/week @ 2025-02-24 2431/week @ 2025-03-03 1136/week @ 2025-03-10

10,094 downloads per month
Used in 7 crates

Apache-2.0

610KB
13K SLoC

rquest

CI Crates.io License Crates.io MSRV crates.io Crates.io Total Downloads

🚀 Help me work seamlessly with open source sharing by sponsoring me on GitHub

An ergonomic all-in-one HTTP client for browser emulation with TLS, JA3/JA4, and HTTP/2 fingerprints.

Features

  • Plain bodies, JSON, urlencoded, multipart
  • Cookie Store
  • Header Order
  • Redirect Policy
  • Rotating Proxies
  • WebSocket Upgrade
  • HTTPS via BoringSSL
  • Emulation Fingerprint

Example

This asynchronous example utilizes Tokio with optional features enabled, requiring the following configuration in Cargo.toml:

[dependencies]
tokio = { version = "1", features = ["full"] }
rquest = "4"
rquest-util = "1"

And then the code:

use rquest::Client;
use rquest_util::Emulation;

#[tokio::main]
async fn main() -> Result<(), rquest::Error> {
    // Build a client
    let client = Client::builder()
        .emulation(Emulation::Firefox136)
        .build()?;

    // Use the API you're already familiar with
    let resp = client.get("https://tls.peet.ws/api/all").send().await?;
    println!("{}", resp.text().await?);

    Ok(())
}

Emulation

  • HTTP/2 over TLS

    JA3/JA4/Akamai fingerprints cannot accurately simulate browser fingerprints due to the sophistication of TLS encryption and the popularity of HTTP/2. rquest does not plan to support parsing these fingerprint strings for simulation. Users are encouraged to customize the configuration according to their own needs.

  • Emulation Device

    In fact, most device models have the same TLS/HTTP2 configuration, except that the User-Agent is changed.

    Device emulation is maintained by rquest-util.

    Default device emulation types
    Browser Versions
    Chrome Chrome100, Chrome101, Chrome104, Chrome105, Chrome106, Chrome107, Chrome108, Chrome109, Chrome114, Chrome116, Chrome117, Chrome118, Chrome119, Chrome120, Chrome123, Chrome124, Chrome126, Chrome127, Chrome128, Chrome129, Chrome130, Chrome131, Chrome132, Chrome133, Chrome134
    Edge Edge101, Edge122, Edge127, Edge131, Edge134
    Safari SafariIos17_2, SafariIos17_4_1, SafariIos16_5, Safari15_3, Safari15_5, Safari15_6_1, Safari16, Safari16_5, Safari17_0, Safari17_2_1, Safari17_4_1, Safari17_5, Safari18, SafariIPad18, Safari18_2, Safari18_1_1, Safari18_3
    OkHttp OkHttp3_9, OkHttp3_11, OkHttp3_13, OkHttp3_14, OkHttp4_9, OkHttp4_10, OkHttp4_12, OkHttp5
    Firefox Firefox109, Firefox117, Firefox128, Firefox133, Firefox135, FirefoxPrivate135, FirefoxAndroid135, Firefox136, FirefoxPrivate136

Building

Avoid compiling with packages that depend on openssl-sys, as it shares the same prefix symbol with boring-sys, potentially leading to link failures and other issues. Even if compilation succeeds, using both openssl-sys and boring-sys together can result in memory segmentation faults. Until the upstream Boring resolves these linking conflicts, using rustls is the best workaround.

Install the dependencies required to build BoringSSL

sudo apt-get install build-essential cmake perl pkg-config libclang-dev musl-tools -y

cargo build --release

This GitHub Actions workflow can be used to compile the project on Linux, Windows, and macOS.

License

Released under the Apache-2.0 License.

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 licensed as above, without any additional terms or conditions.

Sponsors

Support this project by becoming a sponsor.

Accolades

The project is based on a fork of reqwest.

Dependencies

~35–49MB
~1M SLoC