Struct boguin::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
A HTTP(S) client.
Use Client::new().fetch(request)
to make a single request.
Methods
impl Client
[src]
pub fn new() -> Client
[src]
Creates a new client.
Try to use a client for multiple connections as the client may be able to reuse existing connections.
pub fn fetch<A: ToBody, B: FromBody>(
&mut self,
request: Request<A>
) -> Result<Response<B>>
[src]
&mut self,
request: Request<A>
) -> Result<Response<B>>
Send a HTTP request.
This is the main function of the crate. It will send the request using either HTTP or HTTPS to the server. If possible it will reuse connections from the same client. The client follows up to 20 redirects. The body is automatically converted to the expected format.