http://stackoverflow.com/questions/22055251/sending-data-with-angularjs-http-delete-request
I have a resource 'roles' which has a many to many relationship with 'user'. To administer 'roles' I need to send the role id and the user id to the server so that it removes the the role from the correct user (not necessarily the logged in user) Here is what I was attempting but according to the docs this is not possible. I know I can send the two ids in the uri but my laravel backend automatically sets up a resourceful route of resource/{resourceid} which I would like to use if possible. Is there a way to do this that I am missing?
|
||
add a comment
|
You can't do a DELETE via a URL like /users/1/roles/2 ? I think that would be the most RESTful way to do it. Otherwise I guess you can just pass the user id as part of the query params? Something like
|
rest服务在调用的时候 不能在路径中传递参数 而应该通过request 的param来传递参数