Subject: Clarification of http-409

From: troels knak-nielsen <[email-masked]>
Date: Wed, 3 Feb 2010 20:00:31 +0100

Hi list.

There is a question on stack overflow [1] about the proper status code
for a response where the server side validation fails.
The best suggestions seems to be 400 or 409, but is 409 really the
proper response in this situation?

[1] http://stackoverflow.com/questions/2190945/what-http-response-code-for-rest-service-on-put-method-when-domain-rules-invalid

-- 
troels

---

From: Julian Reschke <[email-masked]>
Date: Wed, 03 Feb 2010 20:20:19 +0100

> [1] http://stackoverflow.com/questions/2190945/what-http-response-code-for-rest-service-on-put-method-when-domain-rules-invalid

422 seems to be applicable:

"The 422 (Unprocessable Entity) status code means the server understands 
the content type of the request entity (hence a 415(Unsupported Media 
Type) status code is inappropriate), and the syntax of the request 
entity is correct (thus a 400 (Bad Request) status code is 
inappropriate) but was unable to process the contained instructions. For 
example, this error condition may occur if an XML request body contains 
well-formed (i.e., syntactically correct), but semantically erroneous, 
XML instructions."

-- <http://greenbytes.de/tech/webdav/rfc4918.html#rfc.section.11.2>