Closed Deconstrained closed 1 year ago
On second thought: principle of least user astonishment dictates otherwise. If the API responds with an empty body but JSON was expected, the current error (JSONDecodError or the like) best describes the issue. If None
were returned and the implementation did not expect it, then that would be a breaking behavior of the client.
If the body is empty, it seems appropriate to return
None
fromtry_decoding
rather than raiseJSONDecodeError
.This will resolve #87 by allowing
j*
methods to be used on endpoints that may respond with 204 / no content to request methods other thanDELETE
, i.e. the add-user-to-team endpoint.