NAME

Egg::Response::Headers - Response header class for Egg.

SYNOPSIS

# The response header is set.
$e->response->headers->{'X-Header'}= 'hoge';

# The response header is set.
$e->response->headers->header( 'X-Header' => 'hoge' );

# The response header is deleted.
$e->response->headers->remove('X-Header');

# All the response headers are clear.
$e->response->headers->clear;

DESCRIPTION

It is make a response a header class only for Egg::Response.

METHODS

new

Constructor. Egg::Response::Headers::TieHash The object is returned drinking.

my $headers= $e->response->headers;

The value becomes ARRAY reference of the following content.

  • Original name. Because lc is done as for the key, former name is preserved.

  • Value of header.

header ([KEY], [VALUE])

KEY is always necessary.

The value is set when VALUE is given, and the content corresponding to KEY is returned when omitting it.

my $hoge= $headers->header('X-Hoge');

$headers->header( 'X-Hoge' => 'foo' );

remove ([KEY])

The header corresponding to KEY is deleted.

$headers->remove('X-Hoge');
  • Alias = delete

clear

All set headers are cleared.

$headers->clear;

SEE ALSO

Egg::Release, Egg::Request, Tie::Hash, Tie::Hash::Indexed, Carp,

AUTHOR

Masatoshi Mizuno, <lushe@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2008 Bee Flag, Corp. <http://egg.bomcity.com/>.

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.