2 ms·
For restful HTTP... I like to keep my API strict resources, and nest them if necessary. Also avoid using more than 4-5 verbs per resource. https://github.com/s
by seivan 14y ago
For restful HTTP...
I like to keep my API strict resources, and nest them if necessary. Also avoid using more than 4-5 verbs per resource.
https://github.com/seivan/DocumentationExample https://github.com/seivan/DocumentationExample
POST, PUT, GET (member), GET (collection) and DELETE on a resource and nothing more.
If a resource needs different kinds of colletions (say a filter) I'd use query parameters.
This makes working with API's as a consumer so much easier, especially as a iOS developer. :-)
Very Rails like, I know. I tend only to use the resources and/or resource method keywords. No custom matches and etc. Not for the API anyways.
Just my two cents.