What is the difference between a 200 response and a 201 response?
Choose an answer
Tap an option to check your answer.
Correct answer: 200 generally applies to GET calls,while 201 generally applies to POST calls..
Why this is the answer
The selected answer,"200 generally applies to GET calls,while 201 generally applies to POST calls,"iscorrect because it accurately distinguishes between the HTTP status codes 200 and 201 in the context of API responses.The HTTP status code200("OK")indicates that the request has succeeded and that the server has returned the requested resource.It is commonly used for successful GET requests,where the server responds with the requested data.On the other hand,the HTTP status code 201("Created")indicates that the request has been fulfilled and that a new resource has been created as a result of the request.It is typically used for successful POST requests,where the server creates a new resource based on the data provided in the request payload.Therefore,understanding the distinction between these status codes is crucial for interpreting API responses correctly and determining the outcome of API requests,with 200 indicating successful retrieval of existing resources and 201 indicating successful creation of new resources.The other options provided do not accurately describe the relationship between the status codes 200 and 201,making the identified option the correct choice for this question.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed