Re: Should Web Services be served by a different HTTP n+1?

On 2013-01-24 18:48, Nico Williams wrote:
> On Thu, Jan 24, 2013 at 9:30 AM, Julian Reschke <julian.reschke@gmx.de> wrote:
>> On 2013-01-24 04:18, Grahame Grieve wrote:
>>> What would be right http status code to use? It's a client error, right?
>>> The nearest appropriate status code would be 422, but I'm not sure
>>> whether that can be used outside webdav. Either way, there's a bunch
>>
>> It can.
>>
>> [...]
>>
>> Augmenting error handling for web services is an interesting topic. See
>> prior proposals about Link relations, or a JSON typed response body format
>> for 4xx/5xx.
>
> I've seen APIs that handle errors in JSON-encoded response bodies,
> including one that always returns success in HTTP but errors in the
> response body, which is kinda weird, but if none of the HTTP status
> codes make sense...  (that was the author's defense).

Bad defense, because it still can be classified either as 400 or 500.

2xx is the wrong choice, and I'll not go into the why over here 
(hopefully everybody knows!)

Best regards, Julian

Received on Thursday, 24 January 2013 19:05:52 UTC