Struct chttp::client::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
An HTTP client for making requests.
The client maintains a connection pool internally and is expensive to create, so we recommend re-using your clients instead of discarding and recreating them.
Methods
impl Client
[src]
fn builder() -> ClientBuilder
[src]
Create a new HTTP client builder.
fn new() -> Self
[src]
Create a new HTTP client using the default configuration.
fn get(&self, uri: &str) -> Result<Response, Error>
[src]
Sends a GET request.
fn post<B: Into<Body>>(&self, uri: &str, body: B) -> Result<Response, Error>
[src]
Sends a POST request.
fn put<B: Into<Body>>(&self, uri: &str, body: B) -> Result<Response, Error>
[src]
Sends a PUT request.
fn delete(&self, uri: &str) -> Result<Response, Error>
[src]
Sends a DELETE request.
fn send(&self, request: Request) -> Result<Response, Error>
[src]
Sends a request and returns the response.