404 Not Found

HTTP Response Codes

Question

What is the HTTP response code when the REST API information requested by the authenticated user cannot be found?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

A.

https://airbrake.io/blog/http-errors/401-unauthorized-error#:~:text=The%20401%20Unauthorized%20Error%20is,client%20could%20not%20be%

The correct answer is D. 404.

When an authenticated user sends a request to a REST API and the information requested cannot be found, the server will typically respond with an HTTP status code of 404. This code indicates that the server cannot find the requested resource, and it is a standard response for a resource that is not available.

HTTP response codes are three-digit numbers that indicate the status of the HTTP request. They are grouped into five categories, based on the first digit of the code:

  • 1xx: Informational
  • 2xx: Successful
  • 3xx: Redirection
  • 4xx: Client Error
  • 5xx: Server Error

In this case, the correct answer is D. 404 because it is a client error code, indicating that the problem is with the client's request (in this case, the request for a resource that cannot be found), rather than a server error.

To summarize, when a client sends a request for a resource that cannot be found via a REST API, the server responds with an HTTP status code of 404 to indicate that the requested resource is not available.