1 package Catalyst::Response;
4 use base 'Class::Accessor::Fast';
6 __PACKAGE__->mk_accessors(qw/cookies headers output redirect status/);
8 sub content_encoding { shift->headers->content_encoding(@_) }
9 sub content_length { shift->headers->content_length(@_) }
10 sub content_type { shift->headers->content_type(@_) }
11 sub header { shift->headers->header(@_) }
15 Catalyst::Response - Catalyst Response Class
26 See also L<Catalyst::Application>.
30 This is the Catalyst Response class, which provides a set of accessors to
39 Returns a reference to a hash containing the cookies.
41 $c->response->cookies->{foo} = { value => '123' };
45 Returns a L<HTTP::Headers> object containing the headers.
47 $c->response->headers->header( 'X-Catalyst' => $Catalyst::VERSION );
49 =item $resp->output($text)
51 Contains the final output.
53 $c->response->output('Catalyst rockz!');
55 =item $resp->redirect($url)
57 Contains a location to redirect to.
59 $c->response->redirect('http://slashdot.org');
63 Contains the HTTP status.
65 $c->response->status(404);
71 Sebastian Riedel, C<sri@cpan.org>
75 This program is free software, you can redistribute it and/or modify it under
76 the same terms as Perl itself.