1 package Test::Catalyst::Action::REST::Controller::REST;
4 use namespace::autoclean;
6 BEGIN { extends 'Catalyst::Controller::REST' }
11 entity => { test => 'worked', data => $c->req->data } );
14 sub test_status_created : Local {
15 my ( $self, $c ) = @_;
16 $self->status_created(
19 entity => { status => 'created' }
23 sub test_status_multiple_choices : Local {
24 my ( $self, $c ) = @_;
25 $self->status_multiple_choices(
27 location => '/rest/choice1',
28 entity => { choices => [qw(/rest/choice1 /rest/choice2)] }
32 sub test_status_accepted : Local {
33 my ( $self, $c ) = @_;
34 $self->status_accepted( $c, entity => { status => "queued", } );
37 sub test_status_no_content : Local {
38 my ( $self, $c ) = @_;
39 $self->status_no_content($c);
42 sub test_status_bad_request : Local {
43 my ( $self, $c ) = @_;
44 $self->status_bad_request( $c,
45 message => "Cannot do what you have asked!", );
48 sub test_status_not_found : Local {
49 my ( $self, $c ) = @_;
50 $self->status_not_found( $c,
51 message => "Cannot find what you were looking for!", );
54 sub test_status_gone : Local {
55 my ( $self, $c ) = @_;
56 $self->status_gone( $c,
57 message => "Document have been deleted by foo", );