Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Appropriate http status code for confirmation

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.

like image 301
SanMadJack Avatar asked Oct 21 '22 21:10

SanMadJack


1 Answers

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.

like image 123
CodeCaster Avatar answered Oct 23 '22 22:10

CodeCaster