Stream: implementers
Topic: http status on update
Brian Postlethwaite (Jun 06 2017 at 01:43):
from the spec:
the server SHALL return either a 200 OK HTTP status code if the resource was updated, or a 201 Created status code if the resource was created
However this doesn't say what to return if the resource was previously deleted, and it is now re-created (my server is returning 200 as it existed previously - even though it had been deleted) - which in turn fails some of the Touchstone tests.
Richard Ettema (Jun 06 2017 at 10:41):
My initial take on this behavior was that since the resource instance was being re-"create"d, the action was indeed a "create" and therefore a 201 Created is the expected response. Based on the specification description that @Brian Postlethwaite copied, as well as the fact that even though a resource instance is deleted it can be brought back to an existing state via the update operation, I am now inclined to expect a 200 OK or a 201 Created from this scenario. In any case as the specification does not explicitly declare one response code or the other in this scenario, I am inclined to update the Touchstone tests to accept either. Additional feedback is welcome.
Grahame Grieve (Jun 08 2017 at 20:51):
201 is the correct response. see GF#13498
Richard Ettema (Jun 09 2017 at 01:34):
Thank you.
Last updated: Apr 12 2022 at 19:14 UTC