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
20 $resp->content_encoding;
21 $resp->content_length;
29 See also L<Catalyst::Application>.
33 This is the Catalyst Response class, which provides a set of accessors to
40 =item $resp->content_encoding
42 Shortcut to $resp->headers->content_encoding
44 =item $resp->content_length
46 Shortcut to $resp->headers->content_length
48 =item $resp->content_type
50 Shortcut to $resp->headers->content_type
54 Returns a reference to a hash containing the cookies.
56 $c->response->cookies->{foo} = { value => '123' };
60 Shortcut to $resp->headers->header
64 Returns a L<HTTP::Headers> object containing the headers.
66 $c->response->headers->header( 'X-Catalyst' => $Catalyst::VERSION );
68 =item $resp->output($text)
70 Contains the final output.
72 $c->response->output('Catalyst rockz!');
74 =item $resp->redirect($url)
76 Contains a location to redirect to.
78 $c->response->redirect('http://slashdot.org');
82 Contains the HTTP status.
84 $c->response->status(404);
90 Sebastian Riedel, C<sri@cpan.org>
94 This program is free software, you can redistribute it and/or modify it under
95 the same terms as Perl itself.