diff --git a/server-api/client-tests/web/http.py b/server-api/client-tests/web/http.py index 0e2a523..7db1d78 100644 --- a/server-api/client-tests/web/http.py +++ b/server-api/client-tests/web/http.py @@ -66,7 +66,6 @@ class Response: class Request: def __init__(self, method: str, url: str, params: dict): - assert(domain[len(domain) - 1] != '/') assert(method in ['get', 'post', 'delete']) self.method = method @@ -77,21 +76,22 @@ class Request: # Lower driver for actuall making the request we are looking for method = method.lower() + params = json.dumps(self.params) if method == 'get': - resp = requests.get(self.url, data=self.params) - return Response(self.url, resp.body, resp.status_code, hope) + resp = requests.get(self.url, data=params) + return Response(self.url, resp.text, resp.status_code, hope) elif method == 'post': - resp = requests.post(self.url, data=self.params) - return Response(self.url, resp.body, resp.status_code, hope) + resp = requests.post(self.url, data=self) + return Response(self.url, resp.text, resp.status_code, hope) elif method == 'delete': - resp = requests.delete(self.url, data=self.params) - return Response(self.url, resp.body, resp.status_code, hope) + resp = requests.delete(self.url, data=params) + return Response(self.url, resp.text, resp.status_code, hope) else: raise RequestError('Invalid method passed') - def make(self, hope: int, auth: str) -> Response: + def make(self, hope: int) -> Response: ''' @param hope: int -> status code we hope to get back @return Response -> Wrapper around server http response