Red Hat Bugzilla – Bug 862781
[RFE] [RESTAPI]: missing encoding charset in api json responses
Last modified: 2016-02-10 14:30:48 EST
API responses are missing encoding info in HTTP header Content-Type.
It should have a charset value with the encoding of the response body.
For Example: Content-Type: "application/xml; charset=UTF-8"
I submitted a patch that modifies the application so that it will add the charset to the Content-Type header:
The result is something like this:
HTTP/1.1 200 OK
Date: Thu, 10 Oct 2013 15:37:34 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips
Expires: Thu, 01 Jan 1970 01:00:00 CET
However it isn't clear to me if we want to do this for JSON (as in the subject of the bug) or for XML (as in the initial descrition) or for both.
The solution in comment 4 has been rejected.
Resteasy does not provide a way to dynamically set charset in the response. Only 'hard-coded' solutions seem possible, and since a hard-coded solution has already been rejected (http://gerrit.ovirt.org/20104), we're stuck. It seems not worth the effort at this point.