From 2e159d1eb9b55a0bf3755e5af12d4e03548eb34b Mon Sep 17 00:00:00 2001 From: Douman Date: Sat, 30 Mar 2019 17:53:45 +0300 Subject: [PATCH] test-server: Request functions should accept path (#743) --- test-server/src/lib.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/test-server/src/lib.rs b/test-server/src/lib.rs index 75f75b1e9..b64ff433e 100644 --- a/test-server/src/lib.rs +++ b/test-server/src/lib.rs @@ -159,33 +159,33 @@ impl TestServerRuntime { } /// Create `GET` request - pub fn get(&self) -> ClientRequest { - self.client.get(self.url("/").as_str()) + pub fn get>(&self, path: S) -> ClientRequest { + self.client.get(self.url(path.as_ref()).as_str()) } /// Create https `GET` request - pub fn sget(&self) -> ClientRequest { - self.client.get(self.surl("/").as_str()) + pub fn sget>(&self, path: S) -> ClientRequest { + self.client.get(self.surl(path.as_ref()).as_str()) } /// Create `POST` request - pub fn post(&self) -> ClientRequest { - self.client.post(self.url("/").as_str()) + pub fn post>(&self, path: S) -> ClientRequest { + self.client.post(self.url(path.as_ref()).as_str()) } /// Create https `POST` request - pub fn spost(&self) -> ClientRequest { - self.client.post(self.surl("/").as_str()) + pub fn spost>(&self, path: S) -> ClientRequest { + self.client.post(self.surl(path.as_ref()).as_str()) } /// Create `HEAD` request - pub fn head(&self) -> ClientRequest { - self.client.head(self.url("/").as_str()) + pub fn head>(&self, path: S) -> ClientRequest { + self.client.head(self.url(path.as_ref()).as_str()) } /// Create https `HEAD` request - pub fn shead(&self) -> ClientRequest { - self.client.head(self.surl("/").as_str()) + pub fn shead>(&self, path: S) -> ClientRequest { + self.client.head(self.surl(path.as_ref()).as_str()) } /// Connect to test http server