Subject: | Order of serializer type determination |
It's possible I may be missing something but I've read through all the
RFCs I could find on this topic and this seems to be a requirements bug.
According to the docs and the source code (0.91), the serializer is
chosen based on the incoming (request) content type at a higher priority
than the Accept header to determine which serializer to use. In the
case of POST, PUT, etc, the request content-type header will indicate
the content type of the incoming post data, typically,
"application/x-www-form-urlencoded" (RFC 2616 [1]), not the desired
content type of the returned data. In essence, it's unclear whether the
request content-type header should be consulted at all for selecting a
serializer, but certainly it appears that the Accept header should win
over it.
With this in place, it is nearly impossible to request JSON data via
Accept headers via Javascript without using the query string work-around.
[1] http://tools.ietf.org/html/rfc2616#page-124