Eve::HttpResponse - an HTTP response adapter.
use Eve::HttpResponse; my $response = Eve::HttpResponse->new(nph_mode => 0); $response->set_status(code => 302); $response->set_header(name => 'Location', value => '/other'); $response->set_cookie( name => 'cookie1', value => 'value', domain => '.example.com', path => '/some/', expires => '+1d', secure = >1); $response->set_body(text => 'Hello world!'); print $response->get_text();
The class is an adapter for the Plack::Request module. It is used to store the response data before it is being sent to the client.
Sets or overwrites an HTTP header of the response.
name
value
Sets or overwrites the HTTP response status.
code
Sets an HTTP response cookie.
domain
path
expires
(optional) a cookie expiration time in the epoch format
secure
(optional) defaults to false
Sets or overwrites the HTTP response body.
text
The HTTP response as text.
The passthrough method for the Plack::Request finalize method.
finalize
Encode
HTTP::Status
Plack::Request
Eve::Class
Copyright 2012 Igor Zinovyev.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Eve, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Eve
CPAN shell
perl -MCPAN -e shell install Eve
For more information on module installation, please visit the detailed CPAN module installation guide.