Skip to content

feat(rpc): expose reqwest client#1421

Merged
romac merged 3 commits intocometbft:mainfrom
KaiserKarel:expose-reqwest-client
May 29, 2024
Merged

feat(rpc): expose reqwest client#1421
romac merged 3 commits intocometbft:mainfrom
KaiserKarel:expose-reqwest-client

Conversation

@KaiserKarel
Copy link
Contributor

@KaiserKarel KaiserKarel commented May 18, 2024

Previously, the reqwest client for HttpClient would be unconditionally built by the internal builder, meaning that useful middleware such as tower could not be applied.

This commits adds two ways to create the HttpClient with a custom reqwest::Client, either through new_from_parts, or using the builder.

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

@KaiserKarel KaiserKarel force-pushed the expose-reqwest-client branch 2 times, most recently from 67646cb to 10a92cc Compare May 18, 2024 16:35
Previously, the reqwest client for HttpClient would be unconditionally built
by the internal builder, meaning that useful middleware such as tower could
not be applied.

This commits adds two ways to create the HttpClient with a custom reqwest::Client,
either through new_from_parts, or using the builder.
@KaiserKarel KaiserKarel force-pushed the expose-reqwest-client branch from 10a92cc to 4c8abd5 Compare May 18, 2024 16:37
@romac
Copy link
Contributor

romac commented May 22, 2024

@KaiserKarel Looks great, thanks for the PR! Can you please add a changelog entry for this, mentioning the new Builder::client and HttpClient::new_from_parts methods?

@romac
Copy link
Contributor

romac commented May 22, 2024

Don't worry about the failure on nightly, I'll take care of it.

@romac romac merged commit 04356a3 into cometbft:main May 29, 2024
melekes added a commit to cometbft/cometbft-rs that referenced this pull request May 28, 2025
melekes added a commit to cometbft/cometbft-rs that referenced this pull request May 28, 2025
melekes added a commit to cometbft/cometbft-rs that referenced this pull request May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants