add "put" and "sput" methods for test server

This commit is contained in:
Aliaksandr Rahalevich 2019-06-11 19:40:02 -07:00
parent c4b7980b4f
commit c22b3bd33e
1 changed files with 10 additions and 0 deletions

View File

@ -255,6 +255,16 @@ impl TestServerRuntime {
self.client.head(self.surl(path.as_ref()).as_str()) self.client.head(self.surl(path.as_ref()).as_str())
} }
/// Create `PUT` request
pub fn put<S: AsRef<str>>(&self, path: S) -> ClientRequest {
self.client.put(self.url(path.as_ref()).as_str())
}
/// Create https `PUT` request
pub fn sput<S: AsRef<str>>(&self, path: S) -> ClientRequest {
self.client.put(self.surl(path.as_ref()).as_str())
}
/// Connect to test http server /// Connect to test http server
pub fn request<S: AsRef<str>>(&self, method: Method, path: S) -> ClientRequest { pub fn request<S: AsRef<str>>(&self, method: Method, path: S) -> ClientRequest {
self.client.request(method, path.as_ref()) self.client.request(method, path.as_ref())