Torsten Raudssus > POE-Component-FastCGI-0.19 > POE::Component::FastCGI::Response

Download:
POE-Component-FastCGI-0.19.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

New  1
Open  0
View/Report Bugs
Module Version: 0.19   Source  

NAME ^

POE::Component::FastCGI::Response - PoCo::FastCGI HTTP Response class

SYNOPSIS ^

   use POE::Component::FastCGI::Response;
   my $response = POE::Component::FastCGI::Response->new($client, $id,
      200, ..  HTTP::Response parameters ..);

DESCRIPTION ^

This module is generally not used directly, you should call POE::Component::FastCGI::Request's make_response method which returns an object of this class.

POE::Component::FastCGI::Response is a subclass of HTTP::Response so inherits all of its methods. The includes header() for setting output headers and content() for setting the content.

Therefore the following methods mostly deal with actually sending the response:

$response = POE::Component::FastCGI::Response->new($client, $id, $code)

Creates a new POE::Component::FastCGI::Response object, parameters from $code onwards are passed directly to HTTP::Response's constructor.

$response->streaming

Set and check streaming status

$response->closed

Set a callback to be called when this response is closed, mainly useful for streaming.

$response->send

Sends the response object and ends the current connection.

$response->write($text)

Writes some text directly to the output stream, for use when you don't want to or can't send a HTTP::Response object.

$response->close

Closes the output stream.

You don't normally need to use this as the object will automatically close when DESTROYed.

$response->redirect($url)

Sets the object to be a redirect to $url. You still need to call send to actually send the redirect.

$response->error($code, $text)

Sends an error to the client, $code is the HTTP error code and $text is the content of the page to send.

AUTHOR ^

Copyright 2005, David Leadbeater http://dgl.cx/contact. All rights reserved.

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

BUGS ^

Please let me know.

SEE ALSO ^

POE::Component::FastCGI::Request, HTTP::Response, POE::Component::FastCGI, POE.

syntax highlighting: