I'm implementing an API for a several different client programs to connect to, and I want the api to be able to send back an "are you sure you want to do this?" message, such as when trying to delete something via the api. Looking over the list of established http response codes, I don't see one that seems quite appropriate. I could always skip using a code and provide some other manner of communicating the confirmation, but I would really like to use a standardized method if possible.
The api is normally accessed via a client application, currently a JavaScript-powered one, but I've also made it so that it can be effectively used by directly accessing the api via web browser url.
In what regard would the "Yes I'm sure"-message differ from the "Delete entity 42" message? What would keep clients from immediately sending the "Yes I'm sure"-message? Does your API get accessed by machines or humans?
IMHO this should be solved in the user interface, not in the transport layer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With