I
I
Igor Cherny2015-09-27 11:34:20
RESTful API
Igor Cherny, 2015-09-27 11:34:20

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

1 answer(s)
G
googlevsky, 2015-09-28
@googlevsky

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 question

Ask a Question

731 491 924 answers to any question