4 ms·
I actually have a CRUD-type interface for a database, where everything is done with GET and POST (or PUT or whatever), and I use 409 Conflict to mean "There was
by ReactiveJelly 4y ago
I actually have a CRUD-type interface for a database, where everything is done with GET and POST (or PUT or whatever), and I use 409 Conflict to mean "There was a conflict, someone else edited this, I rejected your edit because your edit was based on an assumption that is no longer true".
I guess if I used AJAX for everything, I could return a 200 OK and a JSON object meaning "actually everything is not okay, there was a conflict" but I did it the simple way first.
- heretogetout 4y agoI've seen 412 "precondition failed" returned when there is that sort of conflict. For example, Google Cloud Storage returns 412 if you try to replace exactly one resource (defined as data + generation or etag) with new data: https://cloud.google.com/storage/docs/request-preconditions https://cloud.google.com/storage/docs/request-preconditions