Struct curl_http::Request [−][src]
pub struct Request<'a> { /* fields omitted */ }
The struct represents the HTTP request.
Methods
impl<'a> Request<'a>
[src]
impl<'a> Request<'a>
pub fn new(
handle: RefMut<'a, Easy>,
method: Method,
url: &str
) -> Result<Request<'a>>
[src]
pub fn new(
handle: RefMut<'a, Easy>,
method: Method,
url: &str
) -> Result<Request<'a>>
pub fn with_header(self, key: &str, value: &str) -> Result<Request<'a>>
[src]
pub fn with_header(self, key: &str, value: &str) -> Result<Request<'a>>
Set the HTTP header.
pub fn with_user_agent(self, ua: &str) -> Result<Request<'a>>
[src]
pub fn with_user_agent(self, ua: &str) -> Result<Request<'a>>
Set custom User-Agent.
pub fn with_arguments(self, args: &str) -> Result<Request<'a>>
[src]
pub fn with_arguments(self, args: &str) -> Result<Request<'a>>
Set custom url arguments or querystring.
pub fn with_json_body<S: Serialize>(self, body: &S) -> Result<Request<'a>>
[src]
pub fn with_json_body<S: Serialize>(self, body: &S) -> Result<Request<'a>>
Set the JSON request body for the request.
pub fn send(self) -> Result<Response>
[src]
pub fn send(self) -> Result<Response>
Sends the request and reads the response body into the response object.