better diagnostics
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Response.pm
CommitLineData
fc7ec1d9 1package Catalyst::Response;
2
3use strict;
4use base 'Class::Accessor::Fast';
5
6__PACKAGE__->mk_accessors(qw/cookies headers output redirect status/);
7
8=head1 NAME
9
10Catalyst::Response - Catalyst Response Class
11
12=head1 SYNOPSIS
13
b22c6668 14 $resp = $c->response;
15 $resp->cookies;
16 $resp->headers;
17 $resp->output;
18 $resp->redirect;
19 $resp->status;
20
21See also L<Catalyst::Application>.
fc7ec1d9 22
23=head1 DESCRIPTION
24
b22c6668 25This is the Catalyst Response class, which provides a set of accessors to
26response data.
27
28=head1 METHODS
fc7ec1d9 29
b22c6668 30=over 4
fc7ec1d9 31
b22c6668 32=item $resp->cookies
fc7ec1d9 33
b22c6668 34Returns a reference to a hash containing the cookies.
fc7ec1d9 35
36 $c->response->cookies->{foo} = { value => '123' };
37
b22c6668 38=item $resp->headers
fc7ec1d9 39
40Returns a L<HTTP::Headers> object containing the headers.
41
42 $c->response->headers->header( 'X-Catalyst' => $Catalyst::VERSION );
43
b22c6668 44=item $resp->output($text)
fc7ec1d9 45
46Contains the final output.
47
48 $c->response->output('Catalyst rockz!');
49
b22c6668 50=item $resp->redirect($url)
fc7ec1d9 51
52Contains a location to redirect to.
53
54 $c->response->redirect('http://slashdot.org');
55
b22c6668 56=item status
fc7ec1d9 57
58Contains the HTTP status.
59
60 $c->response->status(404);
61
b22c6668 62=back
63
fc7ec1d9 64=head1 AUTHOR
65
66Sebastian Riedel, C<sri@cpan.org>
67
68=head1 COPYRIGHT
69
70This program is free software, you can redistribute it and/or modify it under
71the same terms as Perl itself.
72
73=cut
74
751;