closeio / closeio-api

Python API Client for Close
http://developer.close.com/
MIT License
65 stars 47 forks source link

Fix responses with 204 status codes #108

Closed eengoron closed 3 years ago

eengoron commented 3 years ago

This PR fixes an issue where, if we received a 204 response from Close, we'd try to return response.json() and we'd receive a JSONDecodeError:

 json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

because 204 responses have no content to decode.

This change makes it so that if we hit a 204, we just return an empty string.