Skip to content

Commit

Permalink
Add setter for client
Browse files Browse the repository at this point in the history
  • Loading branch information
RossyWhite committed Aug 19, 2024
1 parent c868476 commit d3d67f7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,17 @@ impl Sender {
self.host = host.into();
}

/// Sets client to use for the API. This is useful if you want to customize the client.
pub fn set_client(&mut self, client: Client) {
self.client = client;
}

/// Sets blocking client to use for the API. This is useful if you want to customize the client.
#[cfg(feature = "blocking")]
pub fn set_blocking_client(&mut self, blocking_client: reqwest::blocking::Client) {
self.blocking_client = blocking_client;
}

fn get_headers(&self) -> Result<HeaderMap, InvalidHeaderValue> {
let mut headers = HeaderMap::with_capacity(3);
headers.insert(
Expand Down

0 comments on commit d3d67f7

Please sign in to comment.