|
| Flag
|
Description
|
| MPR_HANDLER_DELETE
|
The handler supports the HTTP DELETE method.
|
| MPR_HANDLER_GET
|
The handler supports the HTTP GET method. |
| MPR_HANDLER_HEAD
|
The handler supports the HTTP HEAD method. |
| MPR_HANDLER_OPTIONS
|
The handler supports the HTTP OPTIONS method. |
| MPR_HANDLER_POST
|
The handler supports the HTTP POST method. |
| MPR_HANDLER_PUT
|
The handler supports the HTTP PUT method. |
| MPR_HANDLER_TRACE
|
The handler supports the HTTP TRACE method. |
| MPR_HANDLER_NEEDS_ENV
|
The handler want to have a hashed symbol table created with CGI
style variables defined.
|
| MPR_HANDLER_ALWAYS
|
The handler always matches incoming requests and does not call the
matchRequest method.
|
| MPR_HANDLER_MAP_VIRTUAL
|
Don't map the URL onto physical storage.
|
| MPR_HANDLER_ALL
|
All the above
|
For example, the following code fragment will configure a handler to be a terminal handler
supporting the GET and POST methods.
MyHandler::MyHandler(char *extensions) : MaHandler("MyHandler", extensions,
MPR_HANDLER_GET | MPR_HANDLER_POST | MPR_HANDLER_NEED_ENV | MPR_HANDLER_TERMINAL)
{
// Code here
}
The Handler sample and the handlers provided in
the Appweb source code demonstrate many other variations on how to create and use handlers.