I have a RESTful web service which requires an end-user license agreement (EULA) to be accepted before it can be used.
Which HTTP status code would be most appropriate for the web service to return if the EULA has not (yet) been accepted?
Currently I see the following possibilities (my current favorite in bold):
- 403 Forbidden
- 412 Precondition Failed
- 417 Expectation Failed
- 423 Locked
- 428 Precondition Required#
- 451 Unavailable For Legal Reasons
The use of the 451 status code implies neither the existence nor nonexistence of the resource named in the request. That is to say, it is possible that if the legal demands were removed, a request for the resource still might not succeed.
tools.ietf.org/html/rfc7725 In other words, it's more like a 404 "this doesn't exist," whereas what you really want to say is "it's there, but I'm not letting you see it." – stephan.com