jjshell — 2013-04-15T03:43:57-04:00 — #1
Here's a situation I have a hard time sorting out. What code should you use when you receive a valid HTTP request but you can't process it because, say, a required parameter is missing? I would say a 200 (the HTTP request itself was well-formed and went fine) which returns an error message.
I guess it's more complicated than that.
I know that Github returns either a 400 or a 422, but that's if the request itself had a problem, right? http://developer.github.com/v3/
logic_earth — 2013-04-15T06:23:41-04:00 — #2
I believe by your description, 400 would be the correct header. A missing, required parameter is bad syntax.
400 Bad Request
The request cannot be fulfilled due to bad syntax.
However, 422 could also be used.
422 Unprocessable Entity
The request was well-formed but was unable to be followed due to semantic errors.
jjshell — 2013-04-15T06:49:36-04:00 — #3
What if there is an error, say, with the database? Which code should it be?
logic_earth — 2013-04-15T09:02:27-04:00 — #4
500 Internal Server Error