What status code should I set for UPDATE (PUT) and DELETE (e.g. product successfully updated)?
What status code should I set for UPDATE ( PUT ) and DELETE (e.g.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For a PUT request: HTTP 200, HTTP 204 should imply "resource updated successfully". HTTP 201 if the PUT request created a new resource.
For a DELETE request: HTTP 200 or HTTP 204 should imply "resource deleted successfully".
HTTP 202 can also be returned by either operation and would imply that the instruction was accepted by the server, but not fully applied yet. It’s possible that the operation fails later, so the client shouldn’t fully assume that it was success.
A client that receives a status code it doesn’t recognize, but it’s starting with 2 should treat it as a 200 OK.
Source: IETF: RFC-9110 Method Definitions
Source: List of HTTP status codes: 2xx Success