pub struct InnerHttpClient { /* private fields */ }Expand description
Internal implementation backing HttpClient.
The underlying Hyper client reuses pooled connections and is cheap to clone. Responses
retain only configured header fields, and bodies larger than max_response_bytes are rejected.
Implementations§
Source§impl InnerHttpClient
impl InnerHttpClient
Sourcepub async fn send_request(
&self,
method: Method,
url: String,
params: Option<&HashMap<String, Vec<String>>>,
headers: Option<HashMap<String, String>>,
body: Option<Vec<u8>>,
timeout_secs: Option<u64>,
) -> Result<HttpResponse, HttpClientError>
pub async fn send_request( &self, method: Method, url: String, params: Option<&HashMap<String, Vec<String>>>, headers: Option<HashMap<String, String>>, body: Option<Vec<u8>>, timeout_secs: Option<u64>, ) -> Result<HttpResponse, HttpClientError>
Sends an HTTP request and returns an HttpResponse.
§Errors
Returns an error if unable to send request or times out.
Sourcepub async fn send_request_with_query<Q: Serialize>(
&self,
method: Method,
url: String,
query: Option<&Q>,
headers: Option<HashMap<String, String>>,
body: Option<Vec<u8>>,
timeout_secs: Option<u64>,
) -> Result<HttpResponse, HttpClientError>
pub async fn send_request_with_query<Q: Serialize>( &self, method: Method, url: String, query: Option<&Q>, headers: Option<HashMap<String, String>>, body: Option<Vec<u8>>, timeout_secs: Option<u64>, ) -> Result<HttpResponse, HttpClientError>
Sends an HTTP request with URL-encoded serializable query parameters.
This method accepts any type implementing Serialize for query parameters,
avoiding HashMap conversion overhead.
§Errors
Returns an error if unable to send request or times out.
Trait Implementations§
Source§impl Clone for InnerHttpClient
impl Clone for InnerHttpClient
Auto Trait Implementations§
impl !Freeze for InnerHttpClient
impl !RefUnwindSafe for InnerHttpClient
impl !UnwindSafe for InnerHttpClient
impl Send for InnerHttpClient
impl Sync for InnerHttpClient
impl Unpin for InnerHttpClient
impl UnsafeUnpin for InnerHttpClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more