2011/7/2 Randall Leeds <[email protected]>:
> 
> No, I meant 400. If we were really being pushy about forcing
> application/json we could reject a request that didn't include it if
> we felt like it.

Not to beat this into the ground, but actually that would be a 406 Not 
Acceptable. (HTTP has a status code for every occasion!) However, the spec 
explicitly says that it’s OK to return JSON even if the client didn’t Accept: 
it:

>       Note: HTTP/1.1 servers are allowed to return responses which are
>       not acceptable according to the accept headers sent in the
>       request. In some cases, this may even be preferable to sending a
>       406 response. User agents are encouraged to inspect the headers of
>       an incoming response to determine if it is acceptable.

<http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>

Which seems eminently reasonable to me.

—Jens

Reply via email to