of the default sub. (daisuke++ pointed out the inconsistency and
provided a patch, and I added the foo_not_implemented support)
- Added in automated OPTIONS handler, which constructs the allow
+ Added in automated OPTIONS handler, which constructs the allow
header for you, just like the 405 handler. Can be overridden
with a normal _METHOD sub.
Refactored Test::Rest, so that it uses closures to create the
- very similar $test->method() subs.
+ very similar $test->method() subs.
Added tests for Catalyst::Action::REST.
=head1 SYNOPSIS
- sub foo :Local :ActionClass('REST') {}
+ sub foo :Local :ActionClass('REST') {
+ ... do setup for HTTP method specific handlers ...
+ }
sub foo_GET {
... do something for GET requests ...
If a method is requested that is not implemented, this action will
return a status 405 (Method Not Found). It will populate the "Allow" header
-with the list of implemented request methods.
+with the list of implemented request methods. You can override this behavior
+by implementing a custom 405 handler like so:
+
+ sub foo_not_implemented {
+ ... handle not implemented methods ...
+ }
+
+If you do not provide an _OPTIONS subroutine, we will automatically respond
+with a 200 OK. The "Allow" header will be populated with the list of
+implemented request methods.
-It is likely that you really want to look at L<Catalyst::Controller::REST>.
+It is likely that you really want to look at L<Catalyst::Controller::REST>,
+which brings this class together with automatic Serialization of requests
+and responses.
=head1 METHODS