incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Alfke <j...@mooseyard.com>
Subject Re: Debugging 302/Unauthorized error
Date Sat, 02 Jul 2011 18:45:59 GMT

2011/7/2 Randall Leeds <randall.leeds@gmail.com>:
> 
> 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
Mime
View raw message