A PUT requests can have many results, and I was wondering which status code would be best for each of them.
Let's say I want to create new resources, so I am doing something like this:
PUT http:
And I would get HTTP 201 because a new resource was created.
Now I want to update this resource, so I am making the same request with the new content:
PUT http:
And I get HTTP 200 or HTTP 204 because the resource is updated. But what if I send this request again with the same content? Should the server return HTTP 200 or HTTP 204 even if nothing is updated?
I know that HTTP 200 and HTTP 204 both simply mean that the request was successfully processed, and even if the data does not change, the request can (and should) still be successfully processed. But is there a way to tell the client that the request was successfully processed, but nothing has changed on the server side? And if so, should it be used to request a PUT ? PUT is idempotent, should a different status be displayed depending on the actual processing on the server side (if there is no error during this processing?)
evuez
source share