Skip to search.
rest-discuss · REST Discussion Mailing List

Group Information

  • Members: 1401
  • Category: Protocols
  • Founded: Nov 13, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

  Messages Help
Advanced
API using 422 status code   Message List  
Reply Message #18547 of 18829 |
Re: [rest-discuss] API using 422 status code

On 2012-02-14 17:07, Philippe Mougin wrote:
>
> Le 14 févr. 2012 à 15:54, Julian Reschke a écrit :
>
>> On 2012-02-14 14:29, Philippe Mougin wrote:
>>> Hi,
>>> Using 422 is fine. It isn't defined the HTTP spec but in RFC 2518, which
>>> is as cool. The HTTP spec allows for definition of new HTTP status codes.
>>
>> RFC 4918, actually. But yes, it's ok to use it; that's why HTTP has a status
code registry.
>>
>>> 422 is used in a number of Web APIs. However, it may not be used as much
>>> in new APIs in the future, as the new definition of 400 in HTTP bis
>>> makes it less needed.
>>
>> How so? Me surprised :-)
>
> One of the main incentive for 422 is that 400 is defined as meaning "The
request could not be understood by the server due to malformed syntax".
Therefore 422 comes handy when you want to signal a client error which isn't
"malformed syntax" and isn't covered by other 4xx codes, but comes from an
"unprocessable entity".
> The new definition of 400 in the current http-bis draft is broader: "The
server cannot or will not process the request, due to a client error (e.g.,
malformed syntax)". Hence, there is less incentives to use 422.

I disagree; if you get this impression then we may have to re-tune the
definition of 400.

If 422 is a good match, there is absolutely no reason to use 400, no
matter what we changed in HTTPbis.

Best regards, Julian



Tue Feb 14, 2012 4:17 pm

julian.reschke@...
Send Email Send Email

Message #18547 of 18829 |
Expand Messages Author Sort by Date

Hi guys, in these days I'm writing an API consumer for a RoR-powered webservice, which uses 422 status code (from WebDav) in HTTP responses. Here's an...
Alessandro Nadalin
alessandro.n... Offline Send Email
Feb 14, 2012
12:12 pm

Alessandro Nadalin <alessandro.nadalin@...> hat am 14. Februar 2012 ... http://www.ruby-forum.com/topic/98002 ... What are you asking for specifically? ...
Jan Algermissen
algermissen1971 Offline Send Email
Feb 14, 2012
12:22 pm

Hi, Using 422 is fine. It isn't defined the HTTP spec but in RFC 2518, which is as cool. The HTTP spec allows for definition of new HTTP status codes. 422 is...
Philippe Mougin
pmougin2001 Offline Send Email
Feb 14, 2012
1:30 pm

... RFC 4918, actually. But yes, it's ok to use it; that's why HTTP has a status code registry. ... How so? Me surprised :-)...
Julian Reschke
julian.reschke@... Send Email
Feb 14, 2012
2:54 pm

... One of the main incentive for 422 is that 400 is defined as meaning "The request could not be understood by the server due to malformed syntax". Therefore...
Philippe Mougin
pmougin2001 Offline Send Email
Feb 14, 2012
4:07 pm

... I disagree; if you get this impression then we may have to re-tune the definition of 400. If 422 is a good match, there is absolutely no reason to use 400,...
Julian Reschke
julian.reschke@... Send Email
Feb 14, 2012
4:17 pm

... With what exactly? ... Well, I even wonder if the WebDAV WG would have minted 422 if 400 was defined as in the http-bis draft back then. BTW, I find the...
Philippe Mougin
pmougin2001 Offline Send Email
Feb 14, 2012
4:53 pm

... Yes, that's why we changed it. But this wasn't done to discourage the use of more specific codes. Best regards, Julian...
Julian Reschke
julian.reschke@... Send Email
Feb 14, 2012
5:03 pm

... Good to know! So I guess that in the process of writing a generic HTTP client, I should implement rfc-2616 (draft standard) and its webdav extension, ...
Alessandro Nadalin
alessandro.n... Offline Send Email
Feb 15, 2012
2:36 pm

... Actually, you should implement the HTTPbis drafts (<http://trac.tools.ietf.org/wg/httpbis/>). If you do things right, you won't need to consider specific...
Julian Reschke
julian.reschke@... Send Email
Feb 15, 2012
2:42 pm

... Yeah, but the approach used by others is pretty different. Just to make an example of a really well engineered php framework (Symfony2): ...
Alessandro Nadalin
alessandro.n... Offline Send Email
Feb 15, 2012
2:52 pm

... It's not only naive, it's a bug. Best regards, Julian...
Julian Reschke
julian.reschke@... Send Email
Feb 15, 2012
3:14 pm
Advanced

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help