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
Source§fn clone(&self) -> InnerHttpClient
fn clone(&self) -> InnerHttpClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InnerHttpClient
impl Debug for InnerHttpClient
Source§impl Default for InnerHttpClient
impl Default for InnerHttpClient
Source§fn default() -> Self
fn default() -> Self
Creates a new default InnerHttpClient instance.
The default client has an empty list of response header keys. Production clients reuse a connection pool; simulated clients open a connection per request.
§Panics
Panics if the production HTTP transport cannot be initialized.