Which HTTP status code to use for required parameters not provided?
问题 I have several pages designed to be called with AJAX - I have them return an abnormal status code if they can't be displayed, and my javascript will show an error box accordingly. For example, if the user is not authenticated or their session has timed out and they try to call one of the AJAX pages, it will return 401 Unathorized . I also have some return 500 Internal Server Error if something really odd happens server-side. What status code should I return if one of these pages was called