SUMMARY: CONSTR | METHOD | DETAIL: CONSTR | METHOD |
Copyright© 2006, Dean Arnold, Presicient Corp., USA
All rights reserved.
Licensed under the Academic Free License version 2.1, as specified in the License.txt file included in this software package, or at OpenSource.org.
Unless otherwise noted, $self
is the object instance variable.
Constructor Summary |
---|
new(LogLevel => value, EventLogger => value, SessionCache => value, ContentParams => value)
Stores ContentParams, SessionCache, and Logger objects, and performs any content-specific initialization |
Method Summary |
---|
getContent($fd, $request, $uri, $params, $session)
Generate and send content |
getHeader($fd, $request, $uri, $params, $session)
Generate and send content header only |
putContent($fd, $request, $uri, $content, $session)
Put content |
setCookie($res, $session)
Set a response cookie |
Constructor Details |
---|
new(LogLevel => value, EventLogger => value, SessionCache => value, ContentParams => value)
LogLevel
=> (optional) logging level; 1 => errors only; 2 => errors and warnings only; 3 => errors, warnings,
and info messages; default 1
EventLogger
=> (optional) Instance of a HTTP::Daemon::Threaded::Logger to receive
event notifications (except for web requests)
SessionCache
=> (optional) threads::shared object implementing HTTP::Daemon::Threaded::SessionCache
ContentParams
=> (optional) name of a ContentsParam concrete implementation
@returns a HTTP::Daemon::Threaded::Content object
Method Details |
---|
getContent($fd, $request, $uri, $params, $session)
$params
parameter may be an array of multipart HTTP::Message objects if
a multipart POST request was received (e.g., for file upload).
Content handlers should restrict the HTTP::Daemon::ClientConn response
methods to send_response(), send_file_response(), send_error(), or
send_redirect()
, as HTTP::Daemon::Threaded::Socket provides
automatic web logging for those methods.
$fd
- HTTP::Daemon::Threaded::Socket object for the client
$request
- HTTP::Request object
$uri
- request URI
$params
- hashref of URL parameters (key => value) OR arrayref of HTTP::Message
objects (for multipart POSTs)
$session
- (optional) a HTTP::Daemon::Threaded::Session object,
if the application configured a SessionCache class, and if WebClient
was able to recover an existing session from such a SessionCache.
getHeader($fd, $request, $uri, $params, $session)
Content handlers should restrict the HTTP::Daemon::ClientConn response
methods to send_response(), send_file_header(), send_error(), or
send_redirect()
, as HTTP::Daemon::Threaded::Socket provides
automatic web logging for those methods.
$fd
- HTTP::Daemon::Threaded::Socket object for the client
$request
- HTTP::Request object
$uri
- request URI
$params
- hashref of URL parameters (key => value)
$session
- (optional) a HTTP::Daemon::Threaded::Session object,
if the application configured a SessionCache class, and if WebClient
was able to recover an existing session from such a SessionCache.
putContent($fd, $request, $uri, $content, $session)
Content handlers should restrict the HTTP::Daemon::ClientConn response
methods to send_response(), send_file_response(), send_file_header(), send_error(), or
send_redirect()
, as HTTP::Daemon::Threaded::Socket provides
automatic web logging for those methods.
$fd
- HTTP::Daemon::Threaded::Socket object for the client
$request
- HTTP::Request object
$uri
- request URI
$content
- decoded PUT content
$session
- (optional) a HTTP::Daemon::Threaded::Session object,
if the application configured a SessionCache class, and if WebClient
was able to recover an existing session from such a SessionCache.
setCookie($res, $session)
$res
- HTTP::Response object
$session
- HTTP::Daemon::Threaded::Session object from which to extract the cookie.