diff --git a/python_http_client/client.py b/python_http_client/client.py index cb051f1..e55f0b3 100644 --- a/python_http_client/client.py +++ b/python_http_client/client.py @@ -16,6 +16,7 @@ class Response(object): """Holds the response from an API call.""" + def __init__(self, response): """ :param response: The return value from a open call @@ -57,6 +58,7 @@ def to_dict(self): class Client(object): """Quickly and easily access any REST or REST-like API.""" + def __init__(self, host, request_headers=None, @@ -225,6 +227,7 @@ def http_request(*_, **kwargs): else: data = json.dumps( kwargs['request_body']).encode('utf-8') + if 'query_params' in kwargs: params = kwargs['query_params'] else: diff --git a/python_http_client/exceptions.py b/python_http_client/exceptions.py index 5c968d6..4df8956 100644 --- a/python_http_client/exceptions.py +++ b/python_http_client/exceptions.py @@ -3,6 +3,7 @@ class HTTPError(Exception): ''' Base of all other errors''' + def __init__(self, error): self.status_code = error.code self.reason = error.reason