pub struct HttpClient { /* private fields */ }Implementations§
Source§impl HttpClient
impl HttpClient
pub fn new(options: HttpClientOptions) -> Result<Self, String>
pub fn default_client() -> Result<Self, String>
pub async fn execute( &self, request: HttpRequest, ) -> Result<HttpResponse, String>
Sourcepub async fn execute_stream(
&self,
request: HttpRequest,
) -> Result<HttpResponseStream, String>
pub async fn execute_stream( &self, request: HttpRequest, ) -> Result<HttpResponseStream, String>
Execute a request without buffering its response body.
The returned metadata is available after response headers arrive. Use
HttpResponseStream::next_chunk for incremental reads, or drop the
stream to cancel the remaining transfer.
pub fn get<U: Into<String>>(&self, url: U) -> HttpRequestBuilder<'_>
pub fn post<U: Into<String>>(&self, url: U) -> HttpRequestBuilder<'_>
pub fn head<U: Into<String>>(&self, url: U) -> HttpRequestBuilder<'_>
pub fn options_ref(&self) -> &HttpClientOptions
Auto Trait Implementations§
impl !RefUnwindSafe for HttpClient
impl !UnwindSafe for HttpClient
impl Forget 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