pub struct HttpClient { /* private fields */ }Expand description
Reusable HTTP client wrapper with shared tracing and request-diagnostic behavior.
Product callers should obtain this through crate::HttpClientFactory for a fixed
destination or use crate::RouteAwareClientPool when request and redirect URLs can vary.
Implementations§
Source§impl HttpClient
impl HttpClient
pub fn new(inner: Client) -> Self
Sourcepub fn new_without_request_logging(inner: Client) -> Self
pub fn new_without_request_logging(inner: Client) -> Self
Creates a client that suppresses request URL and response-header diagnostics.
Use this for endpoints whose URLs or headers may contain credentials that are redacted by the caller above the HTTP transport boundary.
pub fn get<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn head<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn post<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn delete<U>(&self, url: U) -> RequestBuilderwhere
U: IntoUrl,
pub fn request<U>(&self, method: Method, url: U) -> RequestBuilderwhere
U: IntoUrl,
Trait Implementations§
Source§impl Clone for HttpClient
impl Clone for HttpClient
Source§fn clone(&self) -> HttpClient
fn clone(&self) -> HttpClient
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for HttpClient
impl !UnwindSafe for HttpClient
impl Freeze for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
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