Struct slack_api::requests::Client
[−]
[src]
pub struct Client { /* fields omitted */ }
A Client
to make Requests with.
The Client has various configuration values to tweak, but the defaults are set to what is usually the most commonly desired value.
The Client
holds a connection pool internally, so it is advised that
you create one and reuse it.
Methods
impl Client
[src]
fn new() -> Result<Client, Error>
Constructs a new Client
.
fn redirect(&mut self, policy: RedirectPolicy)
Set a RedirectPolicy
for this client.
fn get<U>(&self, url: U) -> RequestBuilder where U: IntoUrl
Convenience method to make a GET
request to a URL.
fn post<U>(&self, url: U) -> RequestBuilder where U: IntoUrl
Convenience method to make a POST
request to a URL.
fn head<U>(&self, url: U) -> RequestBuilder where U: IntoUrl
Convenience method to make a HEAD
request to a URL.
fn request<U>(&self, method: Method, url: U) -> RequestBuilder where U: IntoUrl
Start building a Request
with the Method
and Url
.
Returns a RequestBuilder
, which will allow setting headers and
request body before sending.