Difference between HTTP Status Code 200 and 201

HTTP status codes 200 and 201 are both success codes, but they have different meanings.

HTTP status code 200 means that the request was successful and the server has returned the requested data. This code is commonly used for GET requests, where the client requests data from the server.

HTTP status code 201 means that the request was successful and a new resource has been created on the server. This code is commonly used for POST requests, where the client sends data to the server to create a new resource.

In summary, HTTP status code 200 indicates a successful response to a request for data, while HTTP status code 201 indicates a successful response to a request to create a new resource on the server.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *