pub struct HttpClient { /* private fields */ }
Implementations§
Source§impl HttpClient
impl HttpClient
pub fn new(config: ClientConfig) -> Result<Self>
Sourcepub async fn send(&self, request: Request) -> Result<Response>
pub async fn send(&self, request: Request) -> Result<Response>
Send a prepared request with authentication and error handling
Sourcepub fn get(&self, url: &str) -> RequestBuilder
pub fn get(&self, url: &str) -> RequestBuilder
Create a GET request builder
Sourcepub fn post(&self, url: &str) -> RequestBuilder
pub fn post(&self, url: &str) -> RequestBuilder
Create a POST request builder
Sourcepub fn put(&self, url: &str) -> RequestBuilder
pub fn put(&self, url: &str) -> RequestBuilder
Create a PUT request builder
Sourcepub fn delete(&self, url: &str) -> RequestBuilder
pub fn delete(&self, url: &str) -> RequestBuilder
Create a DELETE request builder
Sourcepub fn extract_request_id(&self, response: &Response) -> Option<RequestId>
pub fn extract_request_id(&self, response: &Response) -> Option<RequestId>
Extract request ID from response headers
Sourcepub fn config(&self) -> &ClientConfig
pub fn config(&self) -> &ClientConfig
Get the current configuration
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 · 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 Freeze for HttpClient
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl !UnwindSafe 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