Answer the question
In order to leave comments, you need to log in
Mobile client-server API: how to correctly update data on the server?
Hello
There is a screen with several checkboxes, the user selects some and clicks Next, the application should send the data to the server. Perhaps the server has other checkboxes for this screen already marked in the table (from another device of this user, for example), should the client take care of deleting them?
That is, should the client send only PUT, and the server logic will delete the old data, or should the client do GET first, and then DELET and PUT?
Reasonable, if possible.
Answer the question
In order to leave comments, you need to log in
If there will be only removal - it is necessary to send only DELETE. If you delete old data and insert new ones, then only PUT. Although the best way would be to update the data (update), if they are stored in the database, since the PUT request describes exactly this action.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question