Struct gotham::test::TestClient
[−]
[src]
pub struct TestClient<NH> where
NH: NewHandler + 'static, { /* fields omitted */ }
Client interface for issuing requests to a TestServer
.
Methods
impl<NH> TestClient<NH> where
NH: NewHandler + 'static,
[src]
NH: NewHandler + 'static,
pub fn head(self, uri: &str) -> RequestBuilder<NH>
[src]
Parse the URI and begin constructing a HEAD request using this TestClient
.
pub fn head_uri(self, uri: Uri) -> RequestBuilder<NH>
[src]
Begin constructing a HEAD request using this TestClient
.
pub fn get(self, uri: &str) -> RequestBuilder<NH>
[src]
Parse the URI and begin constructing a GET request using this TestClient
.
pub fn get_uri(self, uri: Uri) -> RequestBuilder<NH>
[src]
Begin constructing a GET request using this TestClient
.
pub fn post<T>(
self,
uri: &str,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
[src]
self,
uri: &str,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
Parse the URI and begin constructing a POST request using this TestClient
.
pub fn post_uri<T>(
self,
uri: Uri,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
[src]
self,
uri: Uri,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
Begin constructing a POST request using this TestClient
.
pub fn put<T>(
self,
uri: &str,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
[src]
self,
uri: &str,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
Parse the URI and begin constructing a PUT request using this TestClient
.
pub fn put_uri<T>(
self,
uri: Uri,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
[src]
self,
uri: Uri,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
Begin constructing a PUT request using this TestClient
.
pub fn patch<T>(
self,
uri: &str,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
[src]
self,
uri: &str,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
Parse the URI and begin constructing a PATCH request using this TestClient
.
pub fn patch_uri<T>(
self,
uri: Uri,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
[src]
self,
uri: Uri,
body: T,
content_type: Mime
) -> RequestBuilder<NH> where
T: Into<Body>,
Begin constructing a PATCH request using this TestClient
.
pub fn delete(self, uri: &str) -> RequestBuilder<NH>
[src]
Parse the URI and begin constructing a DELETE request using this TestClient
.
pub fn delete_uri(self, uri: Uri) -> RequestBuilder<NH>
[src]
Begin constructing a DELETE request using this TestClient
.
pub fn build_request(self, method: Method, uri: &str) -> RequestBuilder<NH>
[src]
Parse the URI and begin constructing a request with the given HTTP method.
pub fn build_request_uri(self, method: Method, uri: Uri) -> RequestBuilder<NH>
[src]
Begin constructing a request with the given HTTP method and Uri.
pub fn perform(self, req: Request) -> Result<TestResponse, TestRequestError>
[src]
Send a constructed request using this TestClient
, and await the response.