Struct knock::HTTP
[−]
[src]
pub struct HTTP { pub response: Response, pub url: Url, pub method: String, pub body: HashMap<String, Data>, pub header: HashMap<String, String>, // some fields omitted }
Fields
response: Response
url: Url
method: String
body: HashMap<String, Data>
header: HashMap<String, String>
Methods
impl HTTP
[src]
fn new(url: &str) -> Result<HTTP, HttpError>
Create New HTTP
Params: url &str
Response: Result
fn get(&mut self) -> &mut Self
GET request
Params: &mut self (HTTP)
Response: &mut self (HTTP)
fn post(&mut self) -> &mut Self
POST request
Params: &mut self (HTTP)
Response: &mut self (HTTP)
fn put(&mut self) -> &mut Self
PUT request
Params: &mut self (HTTP)
Response: &mut self (HTTP)
fn delete(&mut self) -> &mut Self
DELETE request
Params: &mut self (HTTP)
Response: &mut self (HTTP)
fn request(&mut self, method: &str) -> &mut Self
REQEUST request
Params: &mut self (HTTP), method &str
Response: &mut self (HTTP)
fn body(&mut self, data: HashMap<String, Data>) -> &mut Self
Set Body to self.body
Params: &mut self (HTTP), data HashMap
Response: &mut self (HTTP)
fn header(&mut self, data: HashMap<String, String>) -> &mut Self
Set Headers to self.header
Params: &mut self (HTTP), data HashMap
Response: &mut self (HTTP)
fn send(&mut self) -> Result<Response, HttpError>
Create request, and send
Params: &mut self (HTTP)
Response: Result