Skip to content

Commit 1b81d95

Browse files
committed
Fixes #5. JSON errors when deleting an object
Fixes issue with attempts to parse the body of a 204 No Content response.
1 parent f86909a commit 1b81d95

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

ox3apiclient/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ def post(self, url, data=None):
249249
def delete(self, url):
250250
""""""
251251
res = self.request(self._resolve_url(url), method='DELETE')
252+
# Catch no content responses from some delete actions.
253+
if res.code == 204:
254+
return json.loads('[]')
252255
return json.loads(res.read())
253256

254257

0 commit comments

Comments
 (0)