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


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


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


$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.


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.


Set cookie is returned by HASH reference.


All set cookie is canceled.


'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..)


Accessor to HTTP::Headers object.


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


Masatoshi Mizuno, <>


Copyright (C) 2006 Bee Flag, Corp. <>, 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.