The semantics of webdav have never been reconciled with RESTful idioms.
In theory, GET should get an idea of the state of the resource, and PROPFIND should be used to retrieve the members of the collection.
So you have to do this:
- GET / api / foo1 / - returns only the state foo1
- PROPFIND / api / foo1 / - returns the members of foo1
Most interface developers will exit the game if you told them to use PROPFIND, although it is fully supported in js browser implementations.
Personally, I use the webdav / json gateway, where requests are executed using RESTful idioms, but redirected to my webdav implementation
For example, I would do the following:
GET /api/foo1/_PROPFIND?fields=name,fooProp1,fooProp2
And it will return
[ { name : "bar1", fooProp1: "..", fooProp2 : ".."}, { name : "bar2", fooProp1: "..", fooProp2 : ".."} ]
One of the advantages of this approach is that the client gets the ability to control the return properties of json. This is good because a rich API will have many properties, but in most cases, clients do not need all of them.
brad
source share