Thanks so much for creating this library, it's fantastic :grin:
This PR accounts for a couple of cases where it may not make sense to parse the response body, when the content-length of the response is 0 or when the response code is 204.
Arguably the server should not return a Content-Type: application/json header for a 0 byte body or in the case of a 204 should return Content-Length: 0 but makes the response handling more permissive in bypassing parsing in the two cases above.
Let me know what you think or if you would like the implementation to take a different approach.
Hello!
Thanks so much for creating this library, it's fantastic :grin:
This PR accounts for a couple of cases where it may not make sense to parse the response body, when the content-length of the response is 0 or when the response code is 204.
Arguably the server should not return a
Content-Type: application/json
header for a 0 byte body or in the case of a 204 should returnContent-Length: 0
but makes the response handling more permissive in bypassing parsing in the two cases above.Let me know what you think or if you would like the implementation to take a different approach.