Catalyst::Action::REST::ForBrowsers(3pm)

Catalyst::Action::REST::ForBrowsers3pm

Automated rest method dispatching that accommodates browsers

Usage

    sub foo :Local :ActionClass('REST::ForBrowsers') {
      ... do setup for HTTP method specific handlers ...
    }
    sub foo_GET : Private {
      ... do something for GET requests ...
    }
    sub foo_GET_html : Private {
      ... do something for GET requests from browsers ...
    }
    sub foo_PUT : Private {
      ... do something for PUT requests ...
    }

Overview

This class subclasses Catalyst::Action::REST to add an additional dispatching hook. If the request is a GET request and the request looks like it comes from a browser, it tries to dispatch to a "GET_html" method before trying to the "GET" method instead. All other HTTP methods are dispatched in the same way.

For example, in the synopsis above, calling GET on "/foo" from a browser will end up calling the "foo_GET_html" method. If the request is not from a browser, it will call "foo_GET".

See Catalyst::Action::REST for more details on dispatching details.

Methods

dispatch

This method overrides the default dispatch mechanism to the re-dispatching mechanism described above.

Contributors

Dave Rolsky <[email protected]>

Releases

7 releases since Debian 7 (Wheezy); the text changed 4 times.

  1. 7
  2. 8
  3. 9
  4. 10–11
  5. 12–13

License

You may distribute this code under the same terms as Perl itself.

From libcatalyst-action-rest-perl 1.21-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.