Skip to content

update reqwest dependency and add re-export reqwest::Client#1487

Open
jmwample wants to merge 4 commits into
cometbft:mainfrom
jmwample:jmwample/reqwest-dep
Open

update reqwest dependency and add re-export reqwest::Client#1487
jmwample wants to merge 4 commits into
cometbft:mainfrom
jmwample:jmwample/reqwest-dep

Conversation

@jmwample

@jmwample jmwample commented Feb 21, 2025

Copy link
Copy Markdown

Update the dependency on reqwest to the latest minor version.

Add a type alias that allows downstream libraries to construct and provide an underlying reqwest::Client without being forced to match the library version in their code. i.e. this allows things like:

use tendermint_rpc::{HttpClient, Client, client::{CompatMode, http::ReqwestClient}};

#[tokio::main]
async fn main() {

    // Name your user agent after your app?
    static APP_USER_AGENT: &str = concat!(
        env!("CARGO_PKG_NAME"),
        "/",
        env!("CARGO_PKG_VERSION"),
   );

    let inner = ReqwestClient::builder()
        .user_agent(APP_USER_AGENT)
        .hickory_dns(true)
        .build()
        .unwrap();

    let client = HttpClient::builder("http://127.0.0.1:26657")
        .client(inner)
        .compat_mode(CompatMode::V0_37)
        .build()
        .unwrap();

    let abci_info = client.abci_info()
        .await
        .unwrap();

    println!("Got ABCI info: {:?}", abci_info);
}

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Added entry in .changelog/

Note

Updates reqwest to 0.12 and adds a re-exported InnerClient alias used across HttpClient APIs for easier client injection.

  • RPC HTTP client:
    • Dependency: Bump reqwest from 0.11.20 to 0.12 in rpc/Cargo.toml.
    • Client re-export: Add pub type InnerClient = reqwest::Client; and switch HttpClient internals/Builder/new_from_parts to use InnerClient.
  • Changelog: Add entry noting the reqwest update and reqwest::Client re-export.

Written by Cursor Bugbot for commit eded429. This will update automatically on new commits. Configure here.

Comment thread rpc/src/client/transport/http.rs Outdated
@melekes melekes added the rpc label Apr 9, 2025
@pronebird

pronebird commented Apr 9, 2026

Copy link
Copy Markdown

Can this be reviewed please. reqwest 0.11 pulls hyper v0.14.32 which is really old. reqwest 0.13 is already out too. Thank you. @melekes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants