How to model file system operations with REST?

后端 未结 6 1381
挽巷
挽巷 2021-01-19 05:07

There are obvious counterparts for some of file systems\' basic operations (eg. ls and rm), but how would you implement not straightforwardly RESTf

6条回答
  •  时光取名叫无心
    2021-01-19 05:52

    You could expose a new service that takes (POST) a simple xml doc that outlines what you want to do.

    
       /videos/my_videos/2-gigabyte-video.avi
       /videos/johns_videos/copied-2-gigabyte-video.avi
    
    

    Then this service could return a URI where the client can go and check the status of the operation. Then the client could interact with that new resource to say cancel the move if still pending, or check on it's success.

提交回复
热议问题