NAME

Blosxom::Plugin::Response - Object representing CGI response

SYNOPSIS

use Blosxom::Plugin::Response;

my $response = Blosxom::Plugin::Response->instance;

my $header = $response->header; # Blosxom::Header object
my $body = $response->body; # <!DOCTYPE html> ...

$response->status( 304 );

DESCRIPTION

Object representing CGI response.

CLASS METHODS

Blosxom::Plugin::Response->begin

Exports instance() into context class as response(). res() is an alias.

$response = Blosxom::Plugin::Response->instance

Returns a current Blosxom::Plugin::Response object instance or create a new one.

$response = Blosxom::Plugin::Response->has_instance

Returns a reference to any existing instance or undef if none is defined.

INSTANCE METHODS

$response->header

Returns a Blosxom::Header object instance.

$response->status

A shortcut for $response->header->status.

$response->content_type

A shortcut for $response->header->content_type.

$response->cookie
$response->cookie( ID => 123456 ); # set
my $id = $resposne->cookie( 'ID' ); # get
$response->content_length

A decimal number indicating the size in bytes of the message content.

$response->content_length( 123 );
$response->content_encoding

The Content-Encoding header field is used as a modifier to the media type. When present, its value indicates what additional encoding mechanism has been applied to the resource.

$response->content_encoding( 'gzip' );
$response->location

Gets and sets the Location header.

$response->redirect

Sets redirect URL with an optional status code, which defaults to 302.

$response->redirect( $url );
$response->redirect( $url, 301 );
$response->body

Gets and sets HTTP response body.

$response->body( 'Hello World' );

SEE ALSO

Blosxom::Plugin, Plack::Response, Class::Singleton

AUTHOR

Ryo Anazawa

LICENSE AND COPYRIGHT

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.