How do you handle "actions" on resources in a RESTful design, for example, tagging email?

How would you integrate such things into a RESTful project?

  • Mark message as read
  • History Vote
  • Report message as inappropriate

Also, how would you do it so that you can make a small link or icon button to perform an action without too much magic?

+3
source share
2 answers

It depends on what you do. Sometimes, all that is required is a shift in your point of view from "performing an action on a resource" to "creating another, different, but related resource."

: , , .. . , , , .. , .

. : (, mark_as_read =) mark_as_read params #Update.

. , , . . ( Story), , .

, , . Story, RESTfulness , .

+4

Source: https://habr.com/ru/post/1702331/


All Articles