Moving child resource to another parent in REST -


i have rest service.

and need have functionality move child resources 1 parent another, example move book 1 author another.

my variant is:

post /api/books/x/moveto/y 

but how create such architect restful way?

from rest point of view, urls should used locate resources rather expressing operations. express operations, existing http verbs should used.

looks "move" operation replacing author of book.

and put method seems way go:

4.3.4. put

the put method requests state of target resource created or replaced state defined representation enclosed in request message payload. [...]

so, can have endpoint following:

put /api/books/{bookid}/author 

and request payload contain representation of new author.


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -