Struct curl_http::Client [−][src]
pub struct Client { /* fields omitted */ }
A Http client base on curl.
Methods
impl Client
[src]
impl Client
pub fn new(base_url: &str) -> Client
[src]
pub fn new(base_url: &str) -> Client
Initialize a curl http client based on the base_url.
pub fn set_user_agent(&mut self, user_agent: &str)
[src]
pub fn set_user_agent(&mut self, user_agent: &str)
Set the User-Agent header. Default is curl-http
pub fn request(&self, method: Method, endpoint: &str) -> Result<Request>
[src]
pub fn request(&self, method: Method, endpoint: &str) -> Result<Request>
Make a specific method request.
pub fn get(&self, endpoint: &str) -> Result<Response>
[src]
pub fn get(&self, endpoint: &str) -> Result<Response>
High level HTTP GET method
pub fn post<S: Serialize>(&self, endpoint: &str, body: &S) -> Result<Response>
[src]
pub fn post<S: Serialize>(&self, endpoint: &str, body: &S) -> Result<Response>
High level HTTP POST method
pub fn put<S: Serialize>(&self, endpoint: &str, body: &S) -> Result<Response>
[src]
pub fn put<S: Serialize>(&self, endpoint: &str, body: &S) -> Result<Response>
High level HTTP PUT method
pub fn delete(&self, endpoint: &str) -> Result<Response>
[src]
pub fn delete(&self, endpoint: &str) -> Result<Response>
High level HTTP DELETE method