When a Response object is created, the client expects a Content-Length header in order to fill in details such as the body and api_status. However not all HTTP requests/responses have Content-Length headers. Some API responses from Sift (but not all, it's nondeterministic, but seems related to payload size) use Transfer-Encoding: chunked and thus have no Content-Length header. This results in a response that has a http_status_code of 200, but no api_status or body. This can be fixed by checking the truthiness of the http_response.text attribute, since it will be falsey if there is no body.
When a Response object is created, the client expects a
Content-Length
header in order to fill in details such as thebody
andapi_status
. However not all HTTP requests/responses haveContent-Length
headers. Some API responses from Sift (but not all, it's nondeterministic, but seems related to payload size) useTransfer-Encoding: chunked
and thus have noContent-Length
header. This results in a response that has ahttp_status_code
of 200, but noapi_status
orbody
. This can be fixed by checking the truthiness of thehttp_response.text
attribute, since it will be falsey if there is no body.Pull request incoming for this issue :)