diff --git a/knockapi/_version.py b/knockapi/_version.py index 2dda8e8..3c6f84b 100644 --- a/knockapi/_version.py +++ b/knockapi/_version.py @@ -1 +1 @@ -__version__ = '0.5.13' +__version__ = '0.5.14' diff --git a/knockapi/client.py b/knockapi/client.py index 21914fb..f70aa54 100644 --- a/knockapi/client.py +++ b/knockapi/client.py @@ -30,12 +30,14 @@ def request(self, method, endpoint, payload=None, options={}): timeout=self.timeout, ) - # If we got a successful response, then attempt to deserialize as JSON + # If we got a successful response, check for content before attempting to deserialize as JSON if r.ok: - try: - return r.json() - except JSONDecodeError: - return None + if r.content and len(r.content) > 0: + try: + return r.json() + except JSONDecodeError: + return None + return None return r.raise_for_status()