NAME

Egg::Response - It processes it concerning the response of Egg.

SYNOPSIS

 # Access from Egg to this object.
 $e->response;  or $e->res;
 
 # Content-Type is set.
 $responce->content_type('image/png');
 
 # Contents are output.
 $responce->body('Hello, world!');
 
 # An original header is set.
 $responce->header( 'X-Orign' => 'foooo' );
   or
 $responce->push_header( 'X-Orign' => 'foooo' );
 
 # Redirect
 $response->redirect('http://domainname/', 307);
 
 etc..

DESCRIPTION

 It is a module that takes charge of the contents output of Egg. 

METHODS

$response->content_type([content type]);

output content type is set.

Please set $e->config->{content_type}. default is 'text/html'.

$response->no_cache([1 or 0]);

We will cast a spell so that a browser of the client should not cache it.

$response->set_cache([1 or 0]);

We will cast a spell so that a browser of the client may cache it.

$response->attachment([file_name]);

The 'Content-Disposition' header is set.

 content-disposition: attachment; filename=[file_name]

$response->body([content]); or $response->output([content]);

It keeps it temporarily until contents are output.

It maintains it internally by the Scalar reference.

$response->create_header( $response->body );

Response header is assembled and it returns it.

$response->cookie([KEY NAME], [VALUE]);

Cookie is set with each key.

$response->cookies;

Set cookie is returned by HASH reference.

$response->clear_cookies;

All set cookie is canceled.

$response->create_cookies;

'Set-Cookie' header is assembled and it returns it.

$response->redirect([URL], [status code]);

Screen is forward to passed URL.

Status code can be set by the second argument. default is 302.

$response->status([status code]);

HTTP status code that wants to be returned at the end of processing is set. (200, 404, 403, 500 etc..)

$response->headers;

Accessor to HTTP::Headers object.

SEE ALSO

HTTP::Headers, Egg::Request, Egg::Release,

AUTHOR

Masatoshi Mizuno, <mizuno@bomcity.com>

COPYRIGHT AND LICENSE

Copyright (C) 2006 Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.