I'm just getting started with REST and I've been reading this post and the mentioned book about REST response codes. When I look at Play's Controller class however, it seems to be limited to returning
- 200 - OK
- 301 - Moved Permanently
- 302 - Found
- 304 - Not Modified
- 400 - Bad Request
- 401 - Not Authorized
- 403 - Forbidden
- 404 - Not Found
- 5xx
That seems to leave out some potentially useful codes that were mentioned:
- 201 - Created (good response for successful JSON post?)
- 202 - Accepted (for queued requests)
- 204 - No Content (possible response for successful PUT/POST/DELETE)
- 307 - Temporary Redirect
- 405 - Method Not Allowed
- 406 - Not Acceptable
- 409 - Conflict
- 410 - Gone
- 415 - Unsupported Media Type (this seems like the appropriate response for a request for JSON format when no JSON template is defined)
Are those not needed after all? Is Play handling those situations automatically?
Also it appears that one controller can't handle REST requests and normal web page requests for the same resource very well since the web pages are always returned with 200
. Am I missing anything there?