An easy and powerful Rust HTTP Client

Overview

reqwest

crates.io Documentation MIT/Apache-2 licensed CI

An ergonomic, batteries-included HTTP Client for Rust.

  • Plain bodies, JSON, urlencoded, multipart
  • Customizable redirect policy
  • HTTP Proxies
  • HTTPS via system-native TLS (or optionally, rustls)
  • Cookie Store
  • WASM
  • Changelog

Example

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

[dependencies]
reqwest = { version = "0.11", 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(())
}

Blocking Client

There is an optional "blocking" client API that can be enabled:

[dependencies]
reqwest = { version = "0.11", features = ["blocking", "json"] }
use std::collections::HashMap;

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

Requirements

On Linux:

On Windows and macOS:

  • Nothing.

Reqwest uses rust-native-tls, which will use the operating system TLS framework if available, meaning Windows and macOS. On Linux, it will use OpenSSL 1.1.

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.

Comments
  • cookie jar implementation

    cookie jar implementation

    About a year ago I wrote a user_agent crate (not published to crates.io) for an internal project, which provides the concept of a Session wrapping a Client and does cookie handling per RFC6265. At the time, the only client I targeted was hyper::Client. I'd be interested in updating/adapting the code to reqwest, but wanted to touch base on any existing plans/work here.

    First off, the library suffers some warts:

    • Perhaps not the cleanest rust, one of the first libraries I developed when first learning rust.
    • It implements its own Cookie class, which wraps/extends the existing cookie crate (providing a From implementation to handle conversion). This was to introduce some more domain objects (CookiePath, CookieDomain, etc.) to enforce/aid the implementation of some RFC6265 guidelines.
    • At the time, hyper was on a different (0.1?) version of cookie-rs, whereas I was developing against a more recent version (0.2+?), meaning the library goes through some gyrations to "convert" between the two versions by stringifying-then-parsing cookies.
    • While I wrote a fair set of tests, usage and testing was primarly geared towards my particular use case at the time, so implementation re: RFC6265 may not be complete or necessarily fully correct.

    Some of these issues can be cleaned up over time, but in terms of bigger picture I have some questions/concerns:

    • The re-implementation/extension of Cookie seems un-necessary; submitting PRs against cookie-rs to bring them in line would make sense...
    • cookie-rs already provides a CookieJar, implementing hierarchical jars and jar signing. In my crate, user_agent::CookieStore is more concerned with storing/expiring/updating cookies per RFC6265, and handles storing cookies and setting outgoing cookie headers based on URLs visited during the Session, as well as serializing the current session (to .json currently, but really to anything serde will serialize to) so they can be saved/restored. So, they are in some sense orthogonal currently, but feels as though they could be merged as well.
    • As mentioned, the crate currently tries to generalize the concept of Session, although the only concrete impl is HyperSession. This was done with the vain hope of making a library for "all the webs" (curl clients, etc.), but the realities of needing to get my project done means this was (IMO) sub-optimally implemented. I'm not sure if it makes more sense to ditch the currently not very ergonomic abstraction and focus on implementing specifically towards reqwest, or to fix/maintain the abstraction and publish the crate separately as user_agent and just implement a ReqwestSession here. At a high level, the Session implementation is mainly concerned with defining how to get/set cookies into/out of Request/Response objects.

    Obviously some questions would be more easily answered with some code to review; I just wanted to get a feel for the lay of the land before updating code to be suitable for a PR.

    pr-welcome 
    opened by pfernie 64
  • Hangs in OSX reading certain sized responses unless specifying `Connection::close`

    Hangs in OSX reading certain sized responses unless specifying `Connection::close`

    I'm making an authenticated GET request that succeeds, but any attempt to read_to_string or read_to_end just hangs indefinitely, but only under all the following criteria:

    • OSX (works fine on linux)
    • responses in the range of 3835-16120 bytes (~260 bytes short of the 4K/16K boundaries).
    • over SSL (works fine if I make the same request through a local http nginx proxy)

    This is the debug output of an example Response object I see before it hangs during reading:

    Response { inner: Response { status: Ok, headers: Headers { Date: Wed, 23 Nov 2016 03:06:35 GMT, X-Frame-Options: DENY, Strict-Transport-Security: max-age=0; includeSubDomains; preload, X-Data-Type: directory, Connection: keep-alive, Content-Length: 7452, Content-Type: application/json; charset=utf-8, }, version: Http11, url: "https://api.algorithmia.com/v1/connector/data/anowell/foo", status_raw: RawStatus(200, "OK"), message: Http11Message { is_proxied: false, method: None, stream: Wrapper { obj: Some(Reading(SizedReader(remaining=7452))) } } } }
    

    And yet, I haven't managed to repro this with a simple test script to just reqwest::get some public URL in that size range, so I'm still missing some contributing factor. I've also tried an old build of my client which used hyper+openssl, and it had no issue.

    Things on my mind to try still:

    • Read in smaller chunks to see if perhaps read_to_end is waiting on the wrong number of bytes
    • Put together the minimal repro using an API key for a shareable test account
    • Try a bit harder to find a repro outside of our API
    opened by anowell 47
  • Futures 0.3 [WIP, requesting input]

    Futures 0.3 [WIP, requesting input]

    Port to Futures 0.3

    What?

    The point of this exercise is twofold-

    1. refactor the external API to use futures 0.3 such that this crate is compatible with the async/await syntax
    2. use the async/await syntax internally to refactor this crate

    Why?

    I currently depend on this crate for my crate chesterfield and i've had to use the compat layer to get futures 0.3. This means that there's about 4 places in my codebase where i've had to use the word compat(). For just a few dozen hours of work refactoring reqwest, i can remove these 4 calls. It really is that easy. In all seriousness it should massively contribute to the maintainability of this crate, and make the learning curve a little more shallow for people hoping to contribute features or fix bugs.

    How?

    I've done all the easy parts swapping the old Future and Stream implementations to the new style. I've also moved the crate to the 2018 edition (see #589) to allow to use async/await syntax.

    I'm at a point now where I'd really appreciate some input, both from someone more familiar with this crate, and someone more familiar with the new futures crate.

    • [x] port all the obvious bits from futures 0.1 to futures 0.3

    • [ ] rewrite the 'wait' module with the spawning API (Some help here would be appreciated!)

    • [ ] refactor the tests as required

    • [ ] rewrite the examples using async/await syntax

    • [ ] look for opportunities to refactor internally using async/await syntax. Some obvious candidates include-

      • ClientHandle::new
      • ClientHandle::execute_request
      • "impl Connect for Connector"

    Notes

    I humbly suggest that the best way to start using tokio and hyper 0.1 futures is to use the futures compat layer to convert them to futures 0.3, and vice versa to run 0.3 futures on tokio executors. When tokio and hyper futures 0.3 stabilises, we can switch to the new releases and simply remove the .compat() methods. This way we skip the whole hell of depending on the master version of every dependency.

    ANY INPUT GREATLY APPRECIATED!!

    opened by danieleades 28
  • Add multipart/form-data support

    Add multipart/form-data support

    Inspired by voider1's implementation in #143 . Fix #4

    The most important feature of this version is that the request body is implemented as Read so that it does not need to be stored in memory when files are sent.

    Additionally the API is different. I just went with what felt right to me because I had to change most things from voider1 anyways: In this version there is no additional MultipartRequestBuilder struct, instead there is a multipart method (like json or form) which sets the body of the request appropriately.

    There are still many things marked as TODO in comments in the code where I wasnt sure what the best way to proceed was.

    I also need to add tests, so far I have only written but never ran it.

    We can probably cherry pick the best ideas from both pull requests. I also looked into using existing multipart crates but to me it seems like they cant easily be used none of them implement Read.

    opened by e00E 28
  • Allow opt-in insecure requests to HTTPS URLs

    Allow opt-in insecure requests to HTTPS URLs

    The author of a client library/tool isn't always able to stop a server from using self-signed or otherwise-invalid certificates. Is there a way to ask reqwest to ignore validation for a specific request?

    (In my specific scenario, the server will only respond over HTTPS, so asking over bare HTTP isn't an option either)

    opened by TedDriggs 27
  • Support Async Gzip Decoding

    Support Async Gzip Decoding

    For #161

    I figured I'd open this up for visibility, and because it's easier to talk about code in PRs than issues or gitter. It's an attempt to support decoding in the async implementation, but there may be better approaches. This does introduce a bit of indirection and complexity.

    opened by KodrAus 26
  • POST throws timeout error, even though it gets response

    POST throws timeout error, even though it gets response

    I'm seeing something that has me very confused. I'm making this request:

                match self
                    .client    // A reqwest::blocking::Client
                    .post(&self.url)
                    .header(CONTENT_TYPE, "application/json")
                    .body(request_json.to_string())
                    .send()
    

    The server receives the request, and replies as seen in the server logs:

    [2021-03-11T01:19:34.370440100Z TRACE jsonrpc_core::io] Request: {"id":1,"jsonrpc":"2.0","method":"getSlot","params":[{"commitment":"confirmed"}]}.
    [2021-03-11T01:19:34.370516100Z DEBUG jsonrpc_core::io] Response: {"jsonrpc":"2.0","result":73,"id":1}.
    

    This response gets registered in the client's logs for the request:

    2021-03-11T01:19:34.369761900+00:00 [DEBUG] (12) hyper::client::pool: reuse idle connection for ("http", 172.23.0.12:8899)
    2021-03-11T01:19:34.370162600+00:00 [DEBUG] (12) hyper::proto::h1::io: flushed 189 bytes
    2021-03-11T01:19:34.371146500+00:00 [DEBUG] (12) hyper::proto::h1::io: parsed 3 headers
    2021-03-11T01:19:34.371245700+00:00 [DEBUG] (12) hyper::proto::h1::conn: incoming body is content-length (37 bytes)
    2021-03-11T01:19:34.371366300+00:00 [DEBUG] (12) hyper::proto::h1::conn: incoming body completed
    2021-03-11T01:19:34.371491600+00:00 [DEBUG] (12) hyper::client::pool: pooling idle connection for ("http", 172.23.0.12:8899)
    2021-03-11T01:19:34.371842600+00:00 [DEBUG] (12) reqwest::async_impl::client: response '200 OK' for http://172.23.0.12:8899/
    

    and yet, that code returns an Err:

        ....
        8: error sending request for url (http://172.23.0.12:8899/): operation timed out
        9: operation timed out   // Bottom of stacktrace
    

    How can this be?

    opened by mieubrisse 23
  • Unsolicited response received on idle HTTP channel

    Unsolicited response received on idle HTTP channel

    I'm currently hosting my sites behind the reverse proxy Caddy and I'm using a software called Vigil to periodically poll the status of these sites. Now, the problem is that whenever Vigil polls a site, the following error message shows up in Caddy's logs:

    2018/12/19 23:14:51 Unsolicited response received on idle HTTP channel starting with "0\r\n\r\n"; err=<nil>
    

    The error message appears to be harmless in the sense that both Vigil and Caddy work fine in spite of it, but I still think that it's something that should be looked into because something seems to be wrong with the HTTP request that Vigil sends out when it polls a site.

    I already opened an issue about this problem on Vigil's bug tracker and the author (@valeriansaliou) asked me to also report it on this project's bug tracker because Vigil is using the reqwest library to do HTTP checks,.

    opened by whalehub 23
  • "Too many open files" w/ Async Client

    I've been developing the tooling for an apt replacement with the async client, which may need to fetch a couple dozen files at the same time (depending on how many sources are active and what files those sources' release files point to).

    The following error occurs when sharing a single async::Client across all connections:

    peek 2018-11-13 16-51

    Is this something that could be handled better by reqwest? Perhaps return a NotReady when there's too many files open.

    opened by mmstick 22
  • Deadlock on drop of reqwest::blocking::Response sometimes

    Deadlock on drop of reqwest::blocking::Response sometimes

    Sometimes, when a reqwest::blocking::Response is dropped, it appears to deadlock and the drop call never returns. On my setup, it appears to work roughly 70% of the time. Tested on latest master code as of right now.

    fn main() {
        for _ in 0..10 {
            may_deadlock();
        }
    }
    
    fn may_deadlock() {
        let stream_url = "https://live-bauerse-fm.sharp-stream.com/nrj_instreamtest_se_mp3";
    
        let mut stream = {
            // setup
            let mut builder = reqwest::blocking::Client::builder();
            // note, I used a proxy:
            // builder = builder.proxy(reqwest::Proxy::all("----").unwrap());
            // get the stream
            builder = builder.connect_timeout(std::time::Duration::from_secs(2));
            builder = builder.timeout(std::time::Duration::from_secs(2));
            let client = builder.build().unwrap();
            let builder = client.get(stream_url);
            builder.send().unwrap()
        };
    
        println!("ok, reading some data!");
        let mut buffer = [0; 1400];
        use std::io::Read;
        stream.read(&mut buffer).unwrap();
        println!("attempting to drop stream. This will deadlock SOMETIMES...");
        std::mem::drop(stream);
        println!("we get here as expected ~70% of the time");
    }
    

    ok, reading some data! attempting to drop stream. This will deadlock SOMETIMES... we get here as expected ~70% of the time ok, reading some data! attempting to drop stream. This will deadlock SOMETIMES... we get here as expected ~70% of the time ok, reading some data! attempting to drop stream. This will deadlock SOMETIMES... we get here as expected ~70% of the time ok, reading some data! attempting to drop stream. This will deadlock SOMETIMES...

    then, stuck.

    bug upstream 
    opened by karlri 21
  • add support for self-signed certificates

    add support for self-signed certificates

    This is untested, and based on my PR for hyper-native-tls (https://github.com/sfackler/hyper-native-tls/pull/7), but I'd like to know if you think this is the right direction.

    This is a step toward fixing https://github.com/seanmonstar/reqwest/issues/15

    opened by little-dude 19
  • Rewrite `Error::into_io` to ret inner source if its type is `io::Error`

    Rewrite `Error::into_io` to ret inner source if its type is `io::Error`

    Without the change, Error::into_io would always wrap self in io::Error, even if the source is already is an io::Error.

    Signed-off-by: Jiahao XU [email protected]

    opened by NobodyXu 1
  • Take `Into<Arc<Url>>` in `Request::new` instead of `Url`

    Take `Into>` in `Request::new` instead of `Url`

    Enables the user to create multiple requests with the same url without Url::clone, which could be using different methods, e.g. HEAD first then fallback to GET to check for existence of url, or simply because they want to create multiple request to the same url with the same method, and also avoids Url::clone in Request::try_clone.

    This also avoid calling Url::clone in PendingRequest on creating Error or creating the Response, or when pushing into urls.

    Plus

    • cleanup some clippy warnings
    • Impl Response::url_arc
    • Impl Request::url_arc
    • Impl IntoUrl for Arc<Url> and &Arc<Url>
    • Impl Error::url_arc
    • Apply changes to async_impl::Request to blocking::Request
    • Apply changes to mod wasm

    Signed-off-by: Jiahao XU [email protected]

    opened by NobodyXu 0
  • docs: Add note regarding possible Client::execute panic

    docs: Add note regarding possible Client::execute panic

    Happens here https://github.com/seanmonstar/reqwest/blob/cdbf84feb1d86b8288796631f2120de5363b3ba9/src/async_impl/client.rs#L1544 due to expect call in https://github.com/seanmonstar/reqwest/blob/cdbf84feb1d86b8288796631f2120de5363b3ba9/src/into_url.rs#L67-L71

    It would be nice to get an error that one could recover from, but before it happens, a simple doc change should be sufficient.

    ref: https://github.com/denoland/deno/pull/17164

    opened by kamilogorek 0
  • Sign post requests?

    Sign post requests?

    For curiosity, is there any plan to implement http signatures (https://datatracker.ietf.org/doc/html/draft-cavage-http-signatures-12) like https://docs.rs/http-sig/latest/http_sig/ ?

    opened by AmarOk1412 0
  • Tor proxy example with alpine not working

    Tor proxy example with alpine not working

    I am trying to follow your example for docker https://github.com/seanmonstar/reqwest/blob/master/examples/tor_socks.rs

    Can you please give me a clue why it is not working

    Error: Tor Proxy not found in the main.rs expect

    main.rs

    use reqwest::{Client, Proxy, Response};
    
    #[tokio::main]
    async fn main() {
        let proxy: Proxy = Proxy::all("socks5h://127.0.0.1:9050").expect("Tor Proxy not found");
    
        let client: Client = Client::builder()
            .proxy(proxy)
            .build()
            .expect("Fail to build proxy client");
    
        let res: Response = client
            .get("https://check.torproject.org")
            .send()
            .await
            .unwrap();
    
        println!("Status: {}", res.status());
    
        let text: String = res.text().await.unwrap();
        let is_tor: bool = text.contains("Congratulations. This browser is configured to use Tor.");
        println!("Is Tor: {}", is_tor);
    }
    
    

    Dockerfile

    FROM rust:1.65-alpine3.16 as builder
    
    RUN apk update && apk upgrade
    RUN apk add build-base
    RUN apk add pkgconfig
    RUN apk add openssl-dev
    
    WORKDIR /app
    
    COPY Cargo.toml .
    COPY .cargo .cargo/
    COPY vendor vendor/
    COPY src src/
    
    RUN cargo build --release
    
    ###
    
    FROM alpine:3.16
    
    RUN apk update && apk upgrade
    RUN apk add tor
    RUN apk add torsocks
    RUN apk add openrc
    
    WORKDIR /app
    
    COPY --from=builder /app/target/release/reqwest_test .
    COPY start.sh .
    
    RUN chmod +x start.sh
    
    CMD ./start.sh
    
    

    start.sh

    rc-service tor start &
    
    sleep 1
    
    /app/reqwest_test
    
    opened by krishnaTORQUE 1
Releases(v0.11.13)
  • v0.11.13(Nov 16, 2022)

    What's Changed

    • Add ClientBuilder::dns_resolver() option for custom DNS resolvers.
    • Add ClientBuilder::tls_sni(bool) option to enable or disable TLS Server Name Indication.
    • Add Identity::from_pkcs8_pem() constructor when using native-tls.
    • Fix redirect::Policy::limited(0) from following any redirects.

    New Contributors

    • @NobodyXu made their first contribution in https://github.com/seanmonstar/reqwest/pull/1647
    • @anhcuky made their first contribution in https://github.com/seanmonstar/reqwest/pull/1645
    • @mirecl made their first contribution in https://github.com/seanmonstar/reqwest/pull/1655
    • @irrelevelephant made their first contribution in https://github.com/seanmonstar/reqwest/pull/1653
    • @Alvenix made their first contribution in https://github.com/seanmonstar/reqwest/pull/1669
    • @kianmeng made their first contribution in https://github.com/seanmonstar/reqwest/pull/1562
    Source code(tar.gz)
    Source code(zip)
  • v0.11.12(Sep 20, 2022)

    What's Changed

    • Add ClientBuilder::resolve_to_addrs() which allows a slice of IP addresses to be specified for a single host.
    • Add Response::upgrade() to await whether the server agrees to an HTTP upgrade.

    New Contributors ❤️

    • @futursolo made their first contribution in https://github.com/seanmonstar/reqwest/pull/1565
    • @kckeiks made their first contribution in https://github.com/seanmonstar/reqwest/pull/1583
    • @vidhanio made their first contribution in https://github.com/seanmonstar/reqwest/pull/1584
    • @luqmana made their first contribution in https://github.com/seanmonstar/reqwest/pull/1376
    • @lpraneis made their first contribution in https://github.com/seanmonstar/reqwest/pull/1622
    Source code(tar.gz)
    Source code(zip)
  • v0.11.11(Jun 13, 2022)

    What's Changed

    • Add HTTP/2 keep-alive configuration methods on ClientBuilder.
    • Add ClientBuilder::http1_allow_obsolete_multiline_headers_in_responses().
    • Add impl Service<Request> for Client and &'_ Client.
    • (wasm) Add RequestBuilder::basic_auth().
    • Fix RequestBuilder::header to not override sensitive if user explicitly set on a HeaderValue.
    • Fix rustls parsing of elliptic curve private keys.
    • Fix Proxy URL parsing of some invalid targets.

    New Contributors

    • @jqnatividad made their first contribution in https://github.com/seanmonstar/reqwest/pull/1509
    • @MisileLab made their first contribution in https://github.com/seanmonstar/reqwest/pull/1527
    • @flavio made their first contribution in https://github.com/seanmonstar/reqwest/pull/1526
    • @eyalsatori made their first contribution in https://github.com/seanmonstar/reqwest/pull/1523
    • @Mathspy made their first contribution in https://github.com/seanmonstar/reqwest/pull/1420
    • @cuishuang made their first contribution in https://github.com/seanmonstar/reqwest/pull/1531
    • @Coding-Badly made their first contribution in https://github.com/seanmonstar/reqwest/pull/1539
    • @Osteoporosis made their first contribution in https://github.com/seanmonstar/reqwest/pull/1543
    • @neoeinstein made their first contribution in https://github.com/seanmonstar/reqwest/pull/1556
    Source code(tar.gz)
    Source code(zip)
  • v0.11.10(Mar 14, 2022)

    What's Changed

    • Add Error::url() to access the URL of an error.
    • Add Response::extensions() to access the http::Extensions of a response.
    • Fix rustls-native-certs to log an error instead of panicking when loading an invalid system certificate.
    • Fix passing Basic Authorization header to proxies.

    New Contributors

    • @nikstur made their first contribution in https://github.com/seanmonstar/reqwest/pull/1448
    • @ecclarke42 made their first contribution in https://github.com/seanmonstar/reqwest/pull/1442
    • @TjeuKayim made their first contribution in https://github.com/seanmonstar/reqwest/pull/1316
    • @kraktus made their first contribution in https://github.com/seanmonstar/reqwest/pull/1456
    • @edmorley made their first contribution in https://github.com/seanmonstar/reqwest/pull/1482
    • @ViddeM made their first contribution in https://github.com/seanmonstar/reqwest/pull/1480
    • @nihaals made their first contribution in https://github.com/seanmonstar/reqwest/pull/1490
    • @biluohc made their first contribution in https://github.com/seanmonstar/reqwest/pull/1491
    Source code(tar.gz)
    Source code(zip)
  • v0.11.9(Jan 10, 2022)

    • Add ClientBuilder::http09_responses(bool) option to allow receiving HTTP/0.9 responses.
    • Fix HTTP/2 to retry requests interrupted by an HTTP/2 graceful shutdown.
    • Fix proxy loading from environment variables to ignore empty values.

    New Contributors

    • @vsaase made their first contribution in https://github.com/seanmonstar/reqwest/pull/1423
    Source code(tar.gz)
    Source code(zip)
  • v0.11.8(Jan 10, 2022)

    • Update internal webpki-roots dependency.

    New Contributors

    • @complexspaces made their first contribution in https://github.com/seanmonstar/reqwest/pull/1396
    Source code(tar.gz)
    Source code(zip)
  • v0.11.7(Nov 30, 2021)

    • Add blocking::ClientBuilder::resolve() option, matching the async builder.
    • Implement From<tokio::fs::File> for Body.
    • Fix blocking request-scoped timeout applying to bodies as well.
    • (wasm) Fix request bodies using multipart vs formdata.
    • Update internal rustls to 0.20.

    New Contributors ❤️

    • @jeschkies made their first contribution in https://github.com/seanmonstar/reqwest/pull/1362
    • @niuhuan made their first contribution in https://github.com/seanmonstar/reqwest/pull/1384
    • @BiagioFesta made their first contribution in https://github.com/seanmonstar/reqwest/pull/1388
    Source code(tar.gz)
    Source code(zip)
  • v0.11.6(Nov 2, 2021)

    • Several WASM request body fixes.

    New Contributors

    • @striezel made their first contribution in https://github.com/seanmonstar/reqwest/pull/1346
    • @6543 made their first contribution in https://github.com/seanmonstar/reqwest/pull/1350
    • @crapStone made their first contribution in https://github.com/seanmonstar/reqwest/pull/1354
    • @nwolber made their first contribution in https://github.com/seanmonstar/reqwest/pull/1358
    Source code(tar.gz)
    Source code(zip)
  • v0.11.5(Oct 7, 2021)

    • Add ClientBuilder::http1_only() method.
    • Add tls::Version type, and ClientBuilder::min_tls_version() and ClientBuilder::max_tls_version() methods.
    • Implement TryFrom<Request> for http::Request.
    • Implement Clone for Identity.
    • Fix NO_PROXYenvironment variable parsing to more closely match curl's. Comma-separated entries are now trimmed for whitespace, and * is allowed to match everything.
    • Fix redirection to respect https_only option.
    • (wasm) Add Body::as_bytes() method.
    • (wasm) Fix sometimes wrong conversation of bytes into a JsValue.
    • (wasm) Avoid dependency on serde-serialize feature.

    New Contributors 😍

    • @blyxxyz made their first contribution in https://github.com/seanmonstar/reqwest/pull/1294
    • @Saruniks made their first contribution in https://github.com/seanmonstar/reqwest/pull/1296
    • @dlesl made their first contribution in https://github.com/seanmonstar/reqwest/pull/1313
    • @Dr-Emann made their first contribution in https://github.com/seanmonstar/reqwest/pull/1322
    • @jmgilman made their first contribution in https://github.com/seanmonstar/reqwest/pull/1335
    • @silvioprog made their first contribution in https://github.com/seanmonstar/reqwest/pull/1334
    • @skystar-p made their first contribution in https://github.com/seanmonstar/reqwest/pull/1341
    • @abatkin made their first contribution in https://github.com/seanmonstar/reqwest/pull/1332
    • @VictorBulba made their first contribution in https://github.com/seanmonstar/reqwest/pull/1270
    Source code(tar.gz)
    Source code(zip)
  • v0.11.4(Jun 21, 2021)

    • Add ClientBuilder::resolve() option to override DNS resolution for specific domains.
    • Add native-tls-alpn Cargo feature to use ALPN with the native-tls backend.
    • Add ClientBuilder::deflate() option and deflate Cargo feature to support decoding response bodies using deflate.
    • Add RequestBuilder::version() to allow setting the HTTP version of a request.
    • Fix allowing "invalid" certificates with the rustls-tls backend, when the server uses TLS v1.2 or v1.3.
    • (wasm) Add try_clone to Request and RequestBuilder
    Source code(tar.gz)
    Source code(zip)
  • v0.11.3(Apr 12, 2021)

  • v0.11.2(Mar 9, 2021)

    • Add CookieStore trait to customize the type that stores and retrieves cookies for a session.
    • Add cookie::Jar as a default CookieStore, easing creating some session cookies before creating the Client.
    • Add ClientBuilder::http2_adaptive_window() option to configure an adaptive HTTP2 flow control behavior.
    • Add ClientBuilder::http2_max_frame_size() option to adjust the maximum HTTP2 frame size that can be received.
    • Implement IntoUrl for String, making it more convenient to create requests with format!.
    Source code(tar.gz)
    Source code(zip)
  • v0.11.1(Feb 18, 2021)

    • Add ClientBuilder::tls_built_in_root_certs() option to disable built-in root certificates.
    • Fix rustls-tls glue to more often support ALPN to upgrade to HTTP/2.
    • Fix proxy parsing to assume http:// if no scheme is found.
    • Fix connection pool idle reaping by enabling hyper's runtime feature.
    • (wasm) Add Request::new() constructor.
    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Jan 5, 2021)

    • Change multipart to be an optional cargo feature.
    • Remove deprecated methods.
    • Update to Tokio v1.0.
    • Update to Bytes v1.0.
    • Update to hyper v0.14.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.10(Jan 5, 2021)

    • Add tcp_keepalive option to blocking::ClientBuilder.
    • Add multipart::Part::stream_with_length constructor, to create a streaming part with a known length.
    • Add ClientBuilder::https_only option, to allow requiring URLs to be https.
    • Change default tcp_keepalive value to be disabled.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.9(Nov 20, 2020)

    • Add rustls-tls-native-roots, rustls-tls-webpki-roots, and rustls-tls-manual-roots Cargo features, to configure which certificate roots to use with rustls.
    • Add ClientBuilder::tcp_keepalive() method to enable TCP keepalive.
    • Add ClientBuilder::http1_writev() method to force enable or disable vectored writes.
    • Add Error::is_connect() method to identify if the error is related to connection-establishment.
    • Add blocking::ClientBuilder::brotli() method.
    • Windows: Update default protocol to HTTP for HTTPS system proxies, when a protocol is not specified.
    • (wasm) Add support for Cloudflare workers runtime.
    • (wasm) Add ClientBuilder::default_headers() method.
    • (wasm) Add RequestBuilder::build() method.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.8(Aug 25, 2020)

    • Add must_use to RequestBuilder and ClientBuilder.
    • Fix Windows system proxy detection of Fiddler proxies.
    • (wasm) Add headers method to RequestBuilder.
    • (wasm) Add execute method to Client.
    • (wasm) Add TryFrom<http::Request> for Request.
    • (wasm) Fix checking for global window to work in non-browser environments.
    • (wasm) Fix sending of an empty body when not required.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.7(Jul 24, 2020)

    • Add NO_PROXY environment variable support.
    • Add more Error::{is_request, is_body, is_decode} getters.
    • Add conversion of reqwest::ClientBuilder to reqwest::blocking::ClientBuilder.
    • Add headers_mut() to reqwest::blocking::Response.
    • (wasm) Add form(), query(), multipart and bearer_auth() to RequestBuilder.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.6(May 29, 2020)

    • Changed handling of URLs that don't have http: or https: schemes, returning an error instead.
    • Fixed a potential hyper-rustls feature conflict.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.5(May 28, 2020)

    • Add ClientBuilder::pool_idle_timeout option.
    • Add ClientBuilder::pool_max_idle_per_host option, deprecate max_idle_per_host.
    • Add Response::content_length for WASM target.
    • Enable TCP_NODELAY by default.
    • Implement TryFrom<http::Request> for blocking::Request.
    • Implement TryFrom<http::Request> for Request.
      • Removes From<http::Request> for Request.
      • This is technically a breaking change, but was a mistake. It was not valid to convert from an http::Request to a reqwest::Request in an infallible fashion. It would panic if the conversion was not possible. Instead, the implementation has been changed to TryFrom to indicate it could fail.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.4(Mar 4, 2020)

    • Add trust-dns optional feature to change DNS resolver.
    • Add bytes() method to reqwest::blocking::Response.
    • Add buffer() method to reqwest::blocking::Body.
    • Implement From<http::Request> for reqwest::Request.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.2(Feb 21, 2020)

    • Add Brotli support, enabled with the optional brotli feature. ✨
    • Add Client::use_preconfigured_tls(tls_connector) allowing manual configuration of TLS options.
    • Implement Default for blocking Client, ClientBuilder, and multipart::Form.
    • (wasm) Add Response::error_for_status() method.
    • (wasm) Add Response::json() method.
    • (wasm) Implement Default for Client and ClientBuilder.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.1(Jan 9, 2020)

    • Add socks optional feature to support SOCKS5 proxies.
    • Add RequestBuilder::timeout() to configure a timeout for a single request, instead of using the client's timeout.
    • Add ClientBuilder::connection_verbose() option to enable verbose IO logs.
    • (wasm) Add RequestBuilder::fetch_mode_no_cors() option.
    • (wasm) Add Response::url() getter method.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.0(Dec 30, 2019)

    v0.10.0

    • Add std::future::Future support.

    • Add wasm32-unknown-unknown support (with fewer features).

    • Add ability to pass async Response as the body of another Request.

    • Add Body::as_bytes() method.

    • Add Response::bytes_stream() method to get body as an impl Stream.

    • Add Request::try_clone() method.

    • Change default Client API to async. The previous blocking client API is avaialble at reqwest::blocking.

    • Change to no longer send a default User-Agent header. Add one via ClientBuilder::user_agent().

    • Change to enable system/environment proxy detection by default.

    • Change default-tls feature to only include ClientBuilder options that both native-tls and rustls support.

    • Change default feature set to reduce unnecessary dependencies. Most features are disabled by default:

      • blocking: The reqwest::blocking (synchronous) client API.
      • cookies: Cookie store support.
      • gzip: Automatic response body decompression.
      • json: Request and response JSON body methods.
      • stream: futures::Stream support.
    • Change Error internal design, removing several Error::is_* inspector methods.

    • Change Redirect API:

      • Renamed types to be part of the redirect module (for example, reqwest::RedirectPolicy is now reqwest::redirect::Policy).
      • Removed loop_detected and too_many_redirect methods from redirect::Attempt, replaced with a generic error method.
      • The default policy no longer specifically looks for redirect loops (but they should be caught by the maximum limit).
    • Fix checking HTTP_PROXY environment variable if it the environment is from a CGI script.

    • Fix removal of username/password of parsed proxy URL.

    • Update url to v2.0.

    • Update hyper to v0.13.

    • Update http to v0.2.

    Source code(tar.gz)
    Source code(zip)
  • v0.10.0-alpha.2(Nov 12, 2019)

    • Add Request::try_clone() method.
    • Add HTTP2 window size configuration to ClientBuilder.
    • Add Body::as_bytes() method.
    • Add Response::bytes() method for WASM target.
    • Add RequestBuilder::body() method for WASM target.
    • Change to enable system/environment proxy detection by default.
    • Fix checking HTTP_PROXY environment variable if it the environment is from a CGI script.
    • Fix removal of username/password of parsed proxy URL.
    • Fix pinning async-compression dependency to last alpha.
    Source code(tar.gz)
    Source code(zip)
  • v0.10.0-alpha.1(Oct 8, 2019)

    • Add std::future::Future support.
    • Add wasm32-unknown-unknown support (with fewer features).
    • Add ability to pass async Response as the body of another Request.
    • Change default Client API to async. The previous blocking client API is avaialble at reqwest::blocking.
    • Change default feature set to reduce unnecessary dependencies. Most features are disabled by default:
      • blocking: The reqwest::blocking (synchronous) client API.
      • cookies: Cookie store support.
      • gzip: Automatic response body decompression.
      • json: Request and response JSON body methods.
    • Change futures::Stream support to a disabled-by-default unstable-stream feature.
    • Change Error internal design, removing several Error::is_* inspector methods.
    • Update url to v2.0.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.21(Oct 8, 2019)

  • v0.9.20(Oct 8, 2019)

  • v0.9.19(Jul 19, 2019)

    • Add ClientBuilder::use_sys_proxy() to enable automatic detect of HTTP proxies configured on the system.
    • Add ClientBuilder::no_proxy() to disable system proxies. This is the default for 0.9, but will change to detecting system proxies by default in 0.10.
    • Add support for streaming request bodies in the async client.
    • Add async::Response::text() that returns a Future of the full body decoded to a String.
    • Add Clone for Certificate.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.18(Jul 19, 2019)

Minimal Rust HTTP client for both native and WASM

ehttp: a minimal Rust HTTP client for both native and WASM If you want to do HTTP requests and are targetting both native and web (WASM), then this is

Emil Ernerfeldt 105 Dec 25, 2022
FeignHttp is a declarative HTTP client. Based on rust macros.

FeignHttp is a declarative HTTP client. Based on rust macros. Features Easy to use Asynchronous request Configurable timeout settings Suppor

null 46 Nov 30, 2022
Pretend is a macros-based declarative Rust HTTP client

pretend is a modular, Feign-inspired HTTP, client based on macros. It's goal is to decouple the definition of a REST API from it's implementation.

null 24 Aug 3, 2022
HTTPie: human-friendly CLI HTTP client for the API era

HTTPie: human-friendly CLI HTTP client for the API era HTTPie (pronounced aitch-tee-tee-pie) is a command-line HTTP client. Its goal is to make CLI in

null 25.4k Dec 30, 2022
rh: user-friendly command-line HTTP client

Rust HTTP Cli The command name in your terminal is rh. rh: user-friendly command-line HTTP client rh is a user-friendly, lightweight and performant co

null 8 Nov 30, 2022
Fast and friendly HTTP server framework for async Rust

Tide Serve the web API Docs | Contributing | Chat Tide is a minimal and pragmatic Rust web application framework built for rapid development. It comes

http-rs 4.1k Jan 2, 2023
xh is a friendly and fast tool for sending HTTP requests. It reimplements as much as possible of HTTPie's excellent design, with a focus on improved performance.

xh is a friendly and fast tool for sending HTTP requests. It reimplements as much as possible of HTTPie's excellent design, with a focus on improved performance

Mohamed Daahir 3.4k Jan 6, 2023
An HTTP library for Rust

hyper A fast and correct HTTP implementation for Rust. HTTP/1 and HTTP/2 Asynchronous design Leading in performance Tested and correct Extensive produ

null 11k Jan 8, 2023
Pyre - A fast python HTTP server inspired by japronto written in rust.

Pyre - A fast python HTTP server inspired by japronto written in rust.

null 135 Nov 26, 2022
ratpack: a simpleton's HTTP framework (for rust-lang)

ratpack: a simpleton's HTTP framework (for rust-lang) ratpack is idealized in the simplicity of the sinatra (ruby) framework in its goal, and attempts

ZeroTier, Inc. 5 Jun 29, 2022
A backend providing a HTTP REST like interface for uploading files written in rust.

UploadServer A backend providing a HTTP REST like interface for uploading files written in rust. API Documentation License This project is licensed un

null 4 Nov 20, 2022
🐱‍👤 Drop-in HTTP replacement module for Garry's Mod

??‍?? gmsv_reqwest This module is a drop-in replacement for Garry's Mod's HTTP function, inspired by gmsv_chttp created by timschumi. The module uses

William 38 Dec 12, 2022
Multi-stream HTTP downloader using range requests

chooch - An Amazing Project Downloads files faster than wget/curl (in theory) using multiple connections. Chooch recycles the slowest connection and r

null 13 Sep 14, 2022
Wrapper around reqwest to allow for client middleware chains.

reqwest-middleware A crate implementing a wrapper around reqwest to allow for client middleware chains. Overview The reqwest-middleware client exposes

TrueLayer 113 Dec 7, 2022
Typed, correct GraphQL requests and responses in Rust

graphql_client A typed GraphQL client library for Rust. Features Precise types for query variables and responses. Supports GraphQL fragments, objects,

GraphQL Rust 914 Dec 27, 2022
🕵️Scrape multiple media providers on a cron job and dispatch webhooks when changes are detected.

Jiu is a multi-threaded media scraper capable of juggling thousands of endpoints from different providers with unique restrictions/requirements.

Xetera 47 Dec 6, 2022
Rust bindings to libcurl

curl-rust libcurl bindings for Rust Quick Start use std::io::{stdout, Write}; use curl::easy::Easy; // Print a web page onto stdout fn main() {

Alex Crichton 882 Dec 31, 2022
A GraphQL server library implemented in Rust

A GraphQL server library implemented in Rust Async-graphql is a high-performance server-side library that supports all GraphQL specifications. Feature

null 2.6k Jan 8, 2023
A rule34 scraper made in rust this time

rust-34-scraper A rule34 scraper made in rust this time Building Clone the repository Execute cargo build --release --release is an optimized build pr

null 3 Jun 10, 2022