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