-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: V4.0_WD01
-
Fix Version/s: V4.0_WD01
-
Component/s: JSON Format, Protocol
-
Labels:None
-
Environment:
[Proposed]
-
Proposal:
-
Resolution:
The Accept-Charset request header is defined by RFC2616 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2 ), so OData services SHOULD take it into account.
On the other hand some JSON libraries issue requests with Accept: application/json;charset=utf-n, so OData services SHOULD take that into account, too.
SHOULD is a pain for interoperability, so let's specify MUST.
There are two ways to specify the charset, so we either have to force servers to reject conflicting statements, or define a precedence rule. The latter is friendlier, so we choose it.
RFC2616 is a standard, and appending a format parameter to the media type is just a practice, so the Accept-Charset header takes precedence.
The actual charset of a JSON payload can be determined from the first four octets (http://tools.ietf.org/html/rfc4627#section-3 ), so the format parameter is not necessary in the Content-Type header, and servers needn't include it. Again choice for servers is bad, so they MUST NOT include it.