pub struct Client { /* private fields */ }Expand description
HTTP client that executes requests with libcurl-impersonate.
A client is cheap to clone. Each request creates an isolated curl easy
handle configured from the stored Config.
Implementations§
Source§impl Client
impl Client
Sourcepub async fn send<B>(
&self,
request: Request<B>,
) -> Result<Response<Body>, Error>
pub async fn send<B>( &self, request: Request<B>, ) -> Result<Response<Body>, Error>
Sends a request and returns a streaming response body.
The response resolves once final response headers are available. Body
bytes continue to arrive through Body.
Sourcepub fn send_collect(
&self,
request: Request<Option<Vec<u8>>>,
) -> Result<CollectedResponse, Error>
pub fn send_collect( &self, request: Request<Option<Vec<u8>>>, ) -> Result<CollectedResponse, Error>
Sends a request and collects the full response body into memory.
This is convenient for small documents and tests. Use Self::send for
large responses or incremental consumption.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnsafeUnpin for Client
impl UnwindSafe for Client
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