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]
impl Clientpub fn builder() -> ClientBuilder[src]
pub fn builder() -> ClientBuilderCreate a new HTTP client builder.
pub fn new() -> Self[src]
pub fn new() -> SelfCreate a new HTTP client using the default configuration.
pub fn get(&self, uri: &str) -> Result<Response, Error>[src]
pub fn get(&self, uri: &str) -> Result<Response, Error>Sends a GET request.
pub fn post<B: Into<Body>>(&self, uri: &str, body: B) -> Result<Response, Error>[src]
pub fn post<B: Into<Body>>(&self, uri: &str, body: B) -> Result<Response, Error>Sends a POST request.
pub fn put<B: Into<Body>>(&self, uri: &str, body: B) -> Result<Response, Error>[src]
pub fn put<B: Into<Body>>(&self, uri: &str, body: B) -> Result<Response, Error>Sends a PUT request.
pub fn delete(&self, uri: &str) -> Result<Response, Error>[src]
pub fn delete(&self, uri: &str) -> Result<Response, Error>Sends a DELETE request.
pub fn send(&self, request: Request) -> Result<Response, Error>[src]
pub fn send(&self, request: Request) -> Result<Response, Error>Sends a request and returns the response.