Wombat::Connector::RequestBase - internal request base class
package My::Connector::Request; use base qw(Wombat::Connector::RequestBase);
Convenience base implementation of Wombat::Request and Servlet::ServletRequest which can be used for most connectors. Only connector-specific methods need to be implemented.
Construct and return a Wombat::Connector::RequestBase instance, initializing fields appropriately. If subclasses override the constructor, they must be sure to call
$self->SUPER::new();
Return the Application within which this request is being processed.
Set the Application within which this request is being processed. This must be called as soon as the appropriate Application is identified, because it enables parsing of the request URI.
Parameters:
the Wombat::Application within which the request is being processed
Return the value of the named attribute.
the name of the attribute
Return an array containing the names of the attributes available to this request.
Remove the named attribute from this request.
Set the named attribute in this request.
the value to be set, a scalar or a reference
Return the authorization credentials sent with this request.
Sets the authorization credentials sent with this request.
the authorization credentials
Return the name of the character encoding used in the body of this request.
Set the name of the character encoding used for the body of this request. This method must be called prior to reading request parameters or reading input using getReader().
getReader()
the name of the encoding
Throws:
if this is not a valid encoding
Return the Connector through which this request was received.
Set the Connector through which this request was received.
the Wombat::Connector that received the request
Return the content length, in bytes, of the request body provided by the input handle.
Set the length, in bytes, of the request body provided by the input handle.
the content length in bytes
Return the MIME type of the body of the request.
Set the MIME type of the body of this Request. If the charset parameter is specified, the character encoding of this Request is also set.
charset
the MIME type
Return the underlying input handle associated with this request. Usually the Socket and Handle for the request are the same object, but this is not required.
Set the input handle ssociated with this request.
the IO::Handle associated with this request
Return the Servlet::ServletInputHandle that wraps the underlying input handle (see getHandle(). The default implementation returns a handle created by createInputHandle().
getHandle()
createInputHandle()
if getReader() has already been called for this request
if an input or output exception occurred
Return the preferred locale that the client will accept content in, based on the value for the first Accept-Language header that was encountered. If the request did not specify a preferred language, the server's default locale is returned.
Return the set of preferred locales specified by the client, based on the values for any Accept-Language headers that were encountered. If the request did not specify a preferred language, the server's default locale is returned.
Add a locale to the set of preferred Locales for this Request.
the locale to add
Clear the list of locales for this Request.
Return the value of the named request parameter. If more than one value is defined, return only the first one.
the name of the parameter
Return a hash of the parameters of this Request. The keys of the hash are the parameter names, and the values of the hash are arrays of parameter values.
Return an array containing the names of the parameters contained in this Request.
Return an array containing all of the values of the named request parameter.
Add a named parameter with one or more values to this Request.
the name of the parameter to add
a list of one or more parameter values, scalar or undef
undef
Clear the set of parameters for this Request.
Return the name and version of the protocol used for the request.
Set the name and version of the protocol used for the request in the form protocol/majorVersion.minorVersion.
the name and version of the protocol
Return the XXX that wraps the ServletInputHandle for this request (see getInputHandle(). The default implementation returns a XXX wrapped around handle created by createInputHandle().
getInputHandle()
if the character encoding used is not supported and the text cannot be decoded
if getInputHandle() has already been called for this request
Return the remote IP address of the client making this request.
Set the remote IP address of the client making this request. This value will be used to resolve the name of the remote host if necessary (see getRemoteHost()).
getRemoteHost()
the remote IP address
Return the remote host name of the client making this request.
Set the remote host name of the client making this request.
the remote host name
Return the ServletRequest for which this object is the facade.
Return a Servlet::RequestDispatcher object that acts as a wrapper for the resource located at the given path. The path may be absolute (relative to the context path) or relative to the current request URI.
The path to the resource
Return the Response with which this request is associated.
Set the Response with which this request is associated.
the Wombat::Response with which this request is associated
Return the name of the scheme used to make this request.
Set the name of the scheme used to make this request, for example http, https, or ftp.
the name of the scheme
Return a flag indicating whether or not this request was made using a secure channel.
Set a flag indicating whether or not the request was made using a secure channel.
a boolean value
Return the host name of the server which received this request.
Set the host name of the server which received this request.
the host name
Return the port number on which this request was received.
Set the port number on which this request was received.
the port number
Return the Socket (if any) through which this request was received. This should only be used to access underlying state information about the Socket, such as the SSL information of a IO::Socket::SSL.
Set the Socket (if any) through which this request was received.
the IO::Socket through which this request was received
Return the Wrapper within which this request is being processed.
Set the Wrapper within which this request is being processed. This must be called as soon as the appropriate Wrapper is identified, and before the request is ultimately passed to an application servlet.
the Wombat::Wrapper associated with this request
Create and return a Servlet::ServletInputHandle to read the content associated with this request.
if an input or output error occurs
Perform whatever actions are required to flush and close the input handle or reader.
Release all object references and initialize instances variables in preparation for use or reuse of this object.
IO::Handle, IO::Socket, Servlet::ServletRequest, Servlet::ServletServletInputHandle, Servlet::Util::Exception, Wombat::Application, Wombat::Connector, Wombat::Request, Wombat::Response, Wombat::Wrapper
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.