From d3d67f78def7326de4e569e24d7b451724868399 Mon Sep 17 00:00:00 2001 From: RossyWhite Date: Mon, 19 Aug 2024 18:18:55 +0900 Subject: [PATCH] Add setter for client --- src/v3.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/v3.rs b/src/v3.rs index 14a9d2a..5b2a557 100644 --- a/src/v3.rs +++ b/src/v3.rs @@ -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 { let mut headers = HeaderMap::with_capacity(3); headers.insert(