NAME

Catalyst::Controller::DBIC::API::REST

DESCRIPTION

Provides a REST style API interface to the functionality described in Catalyst::Controller::DBIC::API.

By default provides the following endpoints:

$base (accepts PUT and GET)
$base/[identifier] (accepts POST and DELETE)

Where $base is the URI described by "setup", the chain root of the controller, and the request type will determine the Catalyst::Controller::DBIC::API method to forward.

METHODS

setup

Chained: override PathPart: override CaptureArgs: 0

As described in "setup" in Catalyst::Controller::DBIC::API, this action is the chain root of the controller but has no pathpart or chain parent defined by default, so these must be defined in order for the controller to function. The neatest way is normally to define these using the controller's config.

  __PACKAGE__->config
    ( action => { setup => { PathPart => 'track', Chained => '/api/rest/rest_base' } }, 
	...
  );

base

Chained: "setup" PathPart: none CaptureArgs: 0

Forwards to list level methods described in Catalyst::Controller::DBIC::API as follows:

POST: forwards to "create" in Catalyst::Controller::DBIC::API GET: forwards to "list" in Catalyst::Controller::DBIC::API

object

Chained: "setup" PathPart: none CaptureArgs: 1

Forwards to object level methods described in Catalyst::Controller::DBIC::API as follows:

DELETE: forwards to "delete" in Catalyst::Controller::DBIC::API PUT: forwards to "update" in Catalyst::Controller::DBIC::API

Note: It is often sensible although controversial to give this method a PathPart to clearly distinguish between object and list level methods. You can easily do this by using the controller config as with "setup".

AUTHOR

Luke Saunders <luke.saunders@gmail.com>