it's perfectly valid to return `application/json` (even if a `text/html` representation is available) as (as far as I can tell from the RFC) the default quality is always 1 and ordering is irrelevant, so the relative ordering between `text/html`, `application/xhtml+xml` and `application/json` is left to the server.
Of course further tests show that the server code is in far broken, but still...
(and don't use the PHP code in the comment, it won't work for arbitrary accept extensions and does not return those extensions to the caller)
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8,application/json
it's perfectly valid to return `application/json` (even if a `text/html` representation is available) as (as far as I can tell from the RFC) the default quality is always 1 and ordering is irrelevant, so the relative ordering between `text/html`, `application/xhtml+xml` and `application/json` is left to the server.
Of course further tests show that the server code is in far broken, but still...
(and don't use the PHP code in the comment, it won't work for arbitrary accept extensions and does not return those extensions to the caller)