This is only a problem if your resources are organized to simulate a hierarchical system. Like a file system.
I prefer non-hierarchical resources. The "path" to the file will be just a file property. There are two options for copy-paste.
If you really need another path link, add another entry for the path property. The exact same file is in the βbothβ folders.
If you need a new version of the file, and in the future, after changing the changes, create a new resource (another URI) with a different property "path".
To move, just change the path property.
If you must insist on hierarchical, just imitate the way the file system copies and pastes.
The copy is simple. GET to copy a resource.
Insert POST because you are creating a new resource, a new URI.
If you need to make a move, you probably need to DELETE the old resource.
If you want, you can specify the location in the deletion request so that the server redirects users who were looking for the moved resource in their previous location.
Alex
source share