350-201 · Question #3
What do 2xx HTTP response codes indicate for REST APIs?
The correct answer is D. successful acceptance of the client's request. HTTP 2xx status codes are the standard class indicating that a client request was successfully received, understood, and accepted by the server.
Question
What do 2xx HTTP response codes indicate for REST APIs?
Options
- Aadditional action must be taken by the client to complete the request
- Bthe server takes responsibility for error status codes
- Ccommunication of transfer protocol-level information
- Dsuccessful acceptance of the client's request
How the community answered
(38 responses)- B3% (1)
- C3% (1)
- D95% (36)
Why each option
HTTP 2xx status codes are the standard class indicating that a client request was successfully received, understood, and accepted by the server.
Additional client action such as following a redirect is indicated by 3xx status codes, not 2xx.
Server-side error conditions are communicated through 5xx status codes, which signal that the server failed to fulfill an otherwise valid request.
Transfer protocol-level informational responses are conveyed by 1xx status codes, which provide provisional acknowledgments before the final response is sent.
The 2xx class - including 200 OK, 201 Created, and 204 No Content - signifies that the server successfully processed the client's request. In REST API design, these codes confirm the requested operation completed as expected, which is why they are returned for successful GET, POST, PUT, PATCH, and DELETE operations.
Concept tested: HTTP response status code classes for REST APIs
Source: https://www.rfc-editor.org/rfc/rfc7231#section-6.3
Topics
Community Discussion
No community discussion yet for this question.