Skip to content

Defining the endpoint's available routes (URLs)

jeff-h edited this page Oct 23, 2015 · 6 revisions

RESTful defines a bunch of routes by default for each resource. For example, it provides GET and POST at your resource URL i.e.

GET http://drupalsite.com/api/v1.0/myresource
POST http://drupalsite.com/api/v1.0/myresource

as well as routes for when there's one or more ID's on the end i.e.

GET http://drupalsite.com/api/v1.0/myresource/5,34

These default routes are defined in getControllers() in the RestfulBase class, and can be overridden in your own resource class if needed.

Clone this wiki locally