mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +01:00
Add DELETE, PATCH, OPTIONS methods to TestServerRunner (#973)
This commit is contained in:
parent
8d17c8651f
commit
6f71409355
@ -5,6 +5,7 @@
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
* Add `Responder` impl for `(T, StatusCode) where T: Responder`
|
* Add `Responder` impl for `(T, StatusCode) where T: Responder`
|
||||||
|
* Add `delete`, `options`, `patch` methods to `TestServerRunner`
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -265,6 +265,36 @@ impl TestServerRuntime {
|
|||||||
self.client.put(self.surl(path.as_ref()).as_str())
|
self.client.put(self.surl(path.as_ref()).as_str())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Create `PATCH` request
|
||||||
|
pub fn patch<S: AsRef<str>>(&self, path: S) -> ClientRequest {
|
||||||
|
self.client.patch(self.url(path.as_ref()).as_str())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create https `PATCH` request
|
||||||
|
pub fn spatch<S: AsRef<str>>(&self, path: S) -> ClientRequest {
|
||||||
|
self.client.patch(self.surl(path.as_ref()).as_str())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create `DELETE` request
|
||||||
|
pub fn delete<S: AsRef<str>>(&self, path: S) -> ClientRequest {
|
||||||
|
self.client.delete(self.url(path.as_ref()).as_str())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create https `DELETE` request
|
||||||
|
pub fn sdelete<S: AsRef<str>>(&self, path: S) -> ClientRequest {
|
||||||
|
self.client.delete(self.surl(path.as_ref()).as_str())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create `OPTIONS` request
|
||||||
|
pub fn options<S: AsRef<str>>(&self, path: S) -> ClientRequest {
|
||||||
|
self.client.options(self.url(path.as_ref()).as_str())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Create https `OPTIONS` request
|
||||||
|
pub fn soptions<S: AsRef<str>>(&self, path: S) -> ClientRequest {
|
||||||
|
self.client.options(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())
|
||||||
|
Loading…
Reference in New Issue
Block a user