350-201 · Question #14
What is the HTTP response code when the REST API information requested by the authenticated user cannot be found?
The correct answer is D. 404. HTTP 404 is returned when a requested resource cannot be found on the server, even when the request is properly authenticated.
Question
What is the HTTP response code when the REST API information requested by the authenticated user cannot be found?
Options
- A401
- B402
- C403
- D404
- E405
How the community answered
(25 responses)- A8% (2)
- B4% (1)
- D88% (22)
Why each option
HTTP 404 is returned when a requested resource cannot be found on the server, even when the request is properly authenticated.
401 Unauthorized indicates the request lacks valid authentication credentials, not that the resource is missing.
402 Payment Required is reserved for future use and is not a standard response for missing resources.
403 Forbidden means the server understood the request but refuses to authorize it - the user is authenticated but lacks permission, which is a different scenario from a resource not being found.
HTTP 404 Not Found is the standard response code indicating the server could not locate the requested resource. Authentication status is irrelevant to this code - it specifically signals that the endpoint or resource does not exist at the given URI, which directly matches the scenario described.
405 Method Not Allowed indicates the HTTP method used (GET, POST, etc.) is not supported for the target resource, not that the resource is absent.
Concept tested: HTTP REST API response status codes
Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404
Topics
Community Discussion
No community discussion yet for this question.