Updates and deletes

Dealing with updates and deletes is pretty straightforward. In a hypermedia-based app updates is the process of retrieving a form on resource, filling it in the desired values and submitting (a PUT) back to the server. Deleting, is submitting back (a DELETE) to the server. Each then need to be responded to appropriately on success/failure for redirection or retries. The semantic network code deals with most of these semantics for the application cache.

todo app

Update & Delete

Update is the most complex in the todo app because it does inline editing, multi-editing at one time, delete if empty and cancel (reset changes). You can read the code for this complexity. This instruction is to model a simple update that you would first start with.

Unlock the next chapter
The semantics of an update is
Put the original resource with changes
Put a representation of form fields filled in with a merge of original and new values
PUT on the self link relation of the form
All of the above