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

NAME

Jedi::Response - response object

VERSION

version 1.004

DESCRIPTION

This is the response you will have to fill from route to route.

ATTRIBUTES

status

Status code, by default is 404 (not found).

You can consult the HTTP status but here some common :

 500: internal server error
 404: route not found
 405: access forbidden
 204: no content
 200: status ok, with content
 302: redirect
 301: permanent redirect

headers

This contain the headers you will send with your response.

You should use the method "set_header" and "push_header" instead of filling this attribute directly.

The attribute has this form :

 key => [val1, val2 ...],
 key2 => [val4],

body

The body is the string return to the browser.

 $response->body("Hello World !");

METHODS

set_header

Set an header to a specific value.

 $response->set_header('X-AUTH', $token);
 $response->set_header('Location', 'http://blog.celogeek.com');

push_header

Push an header to a specific value

 $response->push_header('Set-Cookie', 'myCookie=a');
 $response->push_header('Set-Cookie', 'myCookie2=b');

You will see :

 Set-Cookie: myCookie=a
 Set-Cookie: myCookie=b

to_psgi

This return the content in a psgi form.

It is use by Jedi to transform the response into a valid psgi response.

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/celogeek/perl-jedi/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

celogeek <me@celogeek.com>

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 by celogeek <me@celogeek.com>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.