1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use crate::error::Error;

mod request;
mod response;
#[cfg(test)] mod tests;



/// Create a GET Request.
pub fn get(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("GET", url)
}

/// Create a POST Request.
pub fn post(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("POST", url)
}

/// Create a PUT Request.
pub fn put(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("PUT", url)
}

/// Create a PATCH Request.
pub fn patch(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("PATCH", url)
}

/// Create a DELETE Request.
pub fn delete(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("DELETE", url)
}

/// Create a HEAD Request.
pub fn head(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("HEAD", url)
}

/// Create a TRACE Request.
pub fn trace(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("TRACE", url)
}

/// Create a OPTIONS Request.
pub fn options(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("OPTIONS", url)
}

/// Create a CONNECT Request.
pub fn connect(url: &str) -> Result<request::ClientRequest, Error> {
	request::ClientRequest::new("CONNECT", url)
}