REST API error response content does not match declared content-type.
On reporting an error, the REST API returns a response with Content-Type: application/json
, but the content is plain text.
When an client attempts to decode it as JSON, things go down hill.
x $api->response->as_string
0 'HTTP/1.0 400 Bad Request
Date: Sat, 24 Jun 2017 21:23:14 GMT
Server: WSGIServer/0.2 CPython/3.5.3
Content-Length: 19
Content-Type: application/json; charset=UTF-8
Client-Date: Sat, 24 Jun 2017 21:23:25 GMT
Client-Peer: 192.168.148.19:8001
Client-Response-Num: 1
Mailing list exists
'
Either return JSON (please), or at least return an appropriate Content-Type
, e.g. text/plain
See also #356 .