Qore HttpServer Module Reference 1.1.1
|
The HttpServer module provides a multi-threaded HTTP server to Qore programs.
The HttpServer implemented is designed for serving REST, RPC-style, and file-system-based requests as well as other types of traffic with an appropriate handler (for example handlers requiring protocol changes such as with the WebSocket protocol are supported as well).
To use this module, use "%requires HttpServer"
in your code. See examples/httpserver.q for an example program using this module
All the public symbols in the module are defined in the HttpServer namespace.
The main classes is (see HttpServerUtil for supporting definitions; note that the HttpServerUtil module's definitions are also imported into Program objects requiring this module):
See also:
"header-info"
hash to the context argument when calling handlers (issue 3026)HEAD
and other responses that cannot have a message body (bug 3116)"PATCH"
methodContent-Type
in the response header did not necessarily match the encoding of the responsereexport
option) and santized APIs, made HttpListener class private/internal again"ssl"
key to the listener socket info hashContent-Encoding
compression to HttpServer"&"
and ";"
as argument separatorsPUT
and DELETE
methods and for optional message bodies independent of the HTTP methodConnection
header if present from the handlerTCP_NODELAY
by default and use socket shutdown when closing sockets insteadHttpServer::addListenersWithHandler()
methods"listener-id"
to request context hash"identity"
encoding (if anyone ever sends it)"charset=utf-8"
to Content-Type
header if not already present"text/html"
to Content-Type
header if no content-type is given by the handlerTCP_NODELAY
on all sockets to ensure that clients get all data before closing the socket, especially in case of errorsContent-Type
handlingContent-Encoding
support"deflate"
and "gzip"
content-encoding