billdeitrick / pypco

A Python client for the Planning Center Online API.
MIT License
39 stars 13 forks source link

API call w/ No Content throws error #44

Closed warmach closed 1 year ago

warmach commented 3 years ago

I am using the API to run a People List. API call is a POST but it does not return any content, status_code is 204. The problem is that on line 285 of pco.py it is trying to load the json. The code bombs because there is no content to parse.

285 return self.request_response(method, url, payload, upload, **params).json()

Error: JSONDecodeError('Expecting value: line 1 column 1 (char 0)')

Solution would be to check for content before calling json load.

Can you confirm that you see this behavior?

billdeitrick commented 1 year ago

Fixed in 8bb4bff64d8494d36fd3e263bfb20088f46c0acc.