OpenFrame::Response - An abstract response class
use OpenFrame; use OpenFrame::Constants; my $r = OpenFrame::Response->new(); $r->message("<html><body>Hello world!</body></html>"); $r->mimetype('text/html'); $r->code(ofOK); $r->cookies(OpenFrame::Cookies->new());
OpenFrame::Response represents responses inside OpenFrame. Responses represent some kind of response following a request for information.
OpenFrame::Response
This module abstracts the way clients can respond with data from OpenFrame.
This method creates a new OpenFrame::Response object. It takes no parameters.
This method gets and sets the OpenFrame::Cookietin that is associated with this response.
OpenFrame::Cookietin
my $cookietin = $r->cookies(); $r->cookies(OpenFrame::Cookies->new());
This method gets and sets the message string associated with this response. A scalar reference can be stored. It will always be returned as a scalar.
my $message = $r->message(); $r->message("<html><body>Hello world!</body></html>");
This method gets and sets the message code associated with this response. The following message codes are exported when you use OpenFrame::Constants: ofOK, ofERROR, ofREDIRECT, ofDECLINE.
OpenFrame::Constants
my $code = $r->code(); $r->code(ofOK);
This method gets and sets the MIME type associated with this response.
my $type = $r->mimetype(); $r->mimetype('text/html');
James Duncan <jduncan@fotango.com>
To install OpenFrame, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenFrame
CPAN shell
perl -MCPAN -e shell install OpenFrame
For more information on module installation, please visit the detailed CPAN module installation guide.