|
| constructor (*AbstractAuthenticator n_auth, softbool n_stream=False) |
| create the object optionally with the given AbstractAuthenticator More...
|
|
*data | getMessageBody (Socket s, hash< auto > hdr, *data body, bool decode=True) |
| optionally retrieves and post-processes any message body
|
|
hash< HttpResponseInfo > | handleRequest (hash< auto > cx, hash< auto > hdr, *data body) |
| will be called when a request is received that should be directed to the handler More...
|
|
hash< HttpResponseInfo > | handleRequest (HttpListenerInterface listener, Socket s, hash< auto > cx, hash< auto > hdr, *data body) |
| top-level request handling method
|
|
bool | isPersistent () |
| returns True if the current connection is persistent, False if not
|
|
string | maskData (string msg) |
| this method can be used to mask data in debug messages More...
|
|
| notifyClosed (*code c) |
| calls the argument when the persistent connection is closed
|
|
nothing | persistentClosed () |
| called externally when a persistent connection is closed
|
|
| restoreThreadLocalData (*hash data) |
| called after handleRequest() with any data returned from saveThreadData() More...
|
|
*hash | saveThreadLocalData () |
| called before handleRequest() any data returned here will be given to restoreThreadLocalData() after the handleRequest() call More...
|
|
| setPersistent (bool p=True) |
| called externally to notify the handler that the connection will be persistent
|
|
|
static data | decodeBody (string ce, binary body, *string enc) |
| decodes a message body with content-encoding
|
|
static binary | encodeBody (string ce, data body) |
| encodes a message body with content-encoding
|
|
static *string | getLogMessage (hash< auto > cx, hash api, reference params, *reference< string > args) |
| helper method for handling log messages More...
|
|
static hash< HttpResponseInfo > | make400 (string fmt) |
| creates a hash for an HTTP 400 error response with the response message body as a string
|
|
static hash< HttpResponseInfo > | make400 (hash< auto > hdr, string fmt) |
| creates a hash for an HTTP 400 error response with the response message body as a string
|
|
static hash< HttpResponseInfo > | make501 (string fmt) |
| creates a hash for an HTTP 501 error response with the response message body as a string
|
|
static hash< HttpResponseInfo > | make501 (hash< auto > hdr, string fmt) |
| creates a hash for an HTTP 501 error response with the response message body as a string
|
|
static hash< HttpResponseInfo > | makeResponse (int code, string fmt) |
| creates a hash for an HTTP response with the response code and the response message body as a formatted string
|
|
static hash< HttpResponseInfo > | makeResponse (hash< auto > hdr, int code, string fmt) |
| creates a hash for an HTTP response with the response code and the response message body as a formatted string
|
|
static hash< HttpResponseInfo > | makeResponse (int code, *data body, *hash< auto > hdr) |
| creates a hash for an HTTP response with the response code and a literal response message body
|
|
static hash< HttpResponseInfo > | redirect (hash< auto > cx, hash< auto > hdr, string path) |
| generates a redirect hash for the given path
|
|
static | staticNotificationCleanup () |
| removes the thread-local data key in case the object is destroyed in another thread
|
|
static | staticPersistenceCleanup () |
| removes the thread-local data key in case the object is destroyed in another thread
|
|
abstract class that all HTTP request handler objects must inherit from
Reimplement handleRequest() in subclasses
For handlers supporting chunked data (both for receiving and sending), set stream to True in the constructor() method and implement getStreamRequestImpl() to return the HTTP stream request handler.
- See also
- AbstractStreamRequest for information about HTTP stream request handlers