Wombat::Connector::HttpResponseBase - internal http response base class
package My::Connector::HttpResponse; use base qw(Wombat::Connector::HttpResponseBase);
Convenience base implementation of Wombat::HttpResponse and Servlet::Http::HttpServletResponse which can be used for most connectors that implement the HTTP protocol. Only connector-specific methods need to be implemented. Extends Wombat::Connector::ResponseBase.
Construct and return a Wombat::Connector::HttpResponseBase instance, initializing fields appropriately. If subclasses override the constructor, they must be sure to call
$self->SUPER::new();
Return the list of Cookies for this Response.
Add the specified Cookie to those that will be included with this Response.
Parameters:
the Servlet::Http::Cookie to be added
Clear the list of Cookies for this Response;
Add a date value for the named response header.
the name of the response header
the additional header value
Set the date value for the named response header.
the name of the header
the header value
Add a value for the named response header.
Return the value for the first occurrence of the named response header. For all values, use getHeaderValues().
getHeaderValues()
the header name
Return a list of all the header names set for this Response.
Return the list of values for the named response header.
Set the value for the named response header.
Clear the set of headers for this Response;
Set the locale for this Response. The character encoding for this Response will be set to the encoding specified by the locale, and the Content-Language header will be set to the language specified by the locale.
the locale for the response
Return the status message for this Response.
Return the HTTP status code for this Response.
Set the status code for this response.
the HTTP status code
Return a boolean value indicating whether or not the named response header has already been set.
Encode the session ID for this Response into the specified redirect URL, if necessary.
the url to be encoded
Encode the session ID for this Response into the specified URL, if necessary.
Perform whatever actions are required to flush and close the output handle or writer, including sending headers if the response is not already committed.
Throws:
if an input or output error occurs
Force any content in the buffer to be written to the client. Headers are automatically sent and the response is committed on the first invocation of this method.
Clear any data that exists in the content buffer and unsets the content length and content type, all cookies and headers, and the status and message.
if the response has already been committed
Send an error response with the specified status and optional message.
the error status code
the optional descriptive message; if unspecified, the standard message for the given status code will be used.
if an input or output exception occurs
Send a temporary redirect to the specified URL.
the redirect location URL
Write response headers to the output handle, committing the response. Usually doesn't need to be called by other classes, but will be called the first time the buffer is flushed.
Release all object references and initialize instances variables in preparation for use or reuse of this object.
Servlet::ServletResponse, Servlet::Http::Cookie, Servlet::Util::Exception, Wombat::HttpResponse, Wombat::Connector::ResponseBase
Brian Moseley, bcm@maz.org
To install Wombat, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wombat
CPAN shell
perl -MCPAN -e shell install Wombat
For more information on module installation, please visit the detailed CPAN module installation guide.