The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Eve::HttpResponse - an HTTP response abstract class.

SYNOPSIS

    use Eve::HttpResponse::Implementation;

    $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();

DESCRIPTION

The class is an interface defining abstraction that is required to be used as a parent class for various HTTP response implementations.

METHODS

init()

set_header()

Sets or overwrites an HTTP header of the response.

Arguments

name
value

set_status()

Sets or overwrites the HTTP response status.

Arguments

code

set_cookie()

Sets an HTTP response cookie.

Arguments

name
value
domain
path
expires
secure

(optional) defaults to false

set_body()

Sets or overwrites the HTTP response body.

Arguments

text

get_text()

Returns

The HTTP response as text.

SEE ALSO

Eve::Class

LICENSE AND COPYRIGHT

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.

AUTHORS

Igor Zinovyev