93 "101":
"Switching Protocols",
102 "203":
"Non-Authoritative Information",
104 "205":
"Reset Content",
105 "206":
"Partial Content",
108 "207":
"Multi-Status",
111 "208":
"Already Reported",
117 "300":
"Multiple Choices",
118 "301":
"Moved Permanently",
121 "304":
"Not Modified",
124 "307":
"Temporary Redirect",
127 "400":
"Bad Request",
128 "401":
"Unauthorized",
129 "402":
"Payment Required",
132 "405":
"Method Not Allowed",
133 "406":
"Not Acceptable",
134 "407":
"Proxy Authentication Required",
135 "408":
"Request Timeout",
138 "411":
"Length Required",
139 "412":
"Precondition Failed",
140 "413":
"Request Entity Too Large",
141 "414":
"Request-URI Too Long",
142 "415":
"Unsupported Media Type",
143 "416":
"Requested Range Not Satisfiable",
144 "417":
"Expectation Failed",
147 "418":
"I'm a teapot",
150 "420":
"Enhance Yextern Calm",
153 "422":
"Unprocessable Entity",
159 "424":
"Failed Dependency",
162 "425":
"Unordered Collection",
165 "426":
"Upgrade Required",
168 "428":
"Precondition Required",
171 "429":
"Too Many Requests",
174 "431":
"Request Header Fields Too Large",
177 "500":
"Internal Server Error",
178 "501":
"Not Implemented",
179 "502":
"Bad Gateway",
180 "503":
"Service Unavailable",
181 "504":
"Gateway Timeout",
182 "505":
"HTTP Version Not Supported",
183 "509":
"Bandwidth Limit Exceeded",
186 "510":
"Not Extended",
189 "511":
"Network Authentication Required",
233 abstract log(
string fmt);
260 abstract addUserThreadContext(
hash uctx);
265 abstract any removeUserThreadContext(*
string k);
277 bool requiresAuthentication();
293 authenticate(
string user,
string pass =
"");
303 authenticateByIP(
string ip, reference user);
306 private hash getAuthHeader();
309 private hash do401(
string msg =
"Authentication is required to access this server");
390 hash handleRequest();
399 private hash sendResponse();
412 private hash getResponseHeaderMessage();
418 private nothing recv(
hash v);
425 private logChunk(
bool send,
int size);
440 private hash getResponseHeaderMessageImpl();
453 private nothing recvImpl(
hash v);
460 private any sendImpl();
483 bool decompress_to_string =
True;
492 const NotificationThreadKey =
"_AHRH_pc";
495 const PersistenceThreadKey =
"_AHRH_p";
511 setPersistent(
bool p =
True);
515 notifyClosed(*code c);
519 static staticNotificationCleanup();
522 static staticPersistenceCleanup();
525 nothing persistentClosed();
529 private nothing checkPersistent(
hash cx,
hash hdr);
569 static data decodeBody(
string ce,
binary body, *
string enc);
572 static binary encodeBody(
string ce, data body);
575 *data getMessageBody(Socket s,
hash hdr, *data body,
bool decode =
True);
586 static *
string getLogMessage(
hash cx,
hash api, reference params, *reference args);
591 *
hash saveThreadLocalData();
597 restoreThreadLocalData(*
hash data);
601 static hash makeResponse(
int code,
string fmt);
604 static hash makeResponse(
hash hdr,
int code,
string fmt);
607 static hash makeResponse(
int code, *data body, *
hash hdr);
610 static hash make400(
string fmt);
613 static hash make400(
hash hdr,
string fmt);
616 static hash make501(
string fmt);
619 static hash make501(
hash hdr,
string fmt);
643 string getRelativePath(
string path);
690 start(softstring lid,
hash cx,
hash hdr, Socket s);
698 stop(softstring lid);
735 abstract hash handleRequest(
hash cx,
hash hdr, *data b);
753 private abstract startImpl(softstring lid,
hash cx,
hash hdr, Socket s);
758 private stopImpl(
string lid);
string sprintf(string fmt,...)
logErrorArgs(*softlist args)
calls logError() with the given args
hash hdr
a hash of request headers
Definition: HttpServerUtil.qm.dox.h:367
const ReadTimeout
read timeout in ms
Definition: HttpServerUtil.qm.dox.h:87
const HttpCodes
map of HTTP result codes and text messages
Definition: HttpServerUtil.qm.dox.h:90
abstract class for streaming HTTP chunked requests/responses
Definition: HttpServerUtil.qm.dox.h:350
const LP_LOGPARAMS
bit for logging argument
Definition: HttpServerUtil.qm.dox.h:196
abstract class that all HTTP request handler objects must inherit from
Definition: HttpServerUtil.qm.dox.h:472
class providing automatic authentication for all requests
Definition: HttpServerUtil.qm.dox.h:327
*AbstractAuthenticator auth
the optional AbstractAuthenticator for requests to this handler
Definition: HttpServerUtil.qm.dox.h:477
abstract log(string fmt)
called to log information to the registered log code
hash lh
hash of listener references; this is to stop all connections associated with a particular listener ...
Definition: HttpServerUtil.qm.dox.h:658
this abstract class defines the public interface of the private HttpListener class defined in the Htt...
Definition: HttpServerUtil.qm.dox.h:254
AbstractHttpRequestHandler handler
the request handler for the request
Definition: HttpServerUtil.qm.dox.h:361
bool stream
if the handler supports streaming requests/responses with chunked data
Definition: HttpServerUtil.qm.dox.h:486
string http_get_url_from_bind(softstring bind, *string host)
returns a complete URL from a bind address
abstract base class for external authentication
Definition: HttpServerUtil.qm.dox.h:271
hash cx
the call context variable
Definition: HttpServerUtil.qm.dox.h:365
Socket s
the Socket object for the response
Definition: HttpServerUtil.qm.dox.h:363
const HttpServerVersion
version of the HttpServer's implementation
Definition: HttpServerUtil.qm.dox.h:78
hash parse_uri_query(string path)
parses a URI path for a arguments and a method; where the method is the part of the path before the f...
HttpListenerInterface listener
an HttpListenerInterface object for the listener serving the request for logging purposes ...
Definition: HttpServerUtil.qm.dox.h:359
this abstract class defines the interface for classes that provide logging methods ...
Definition: HttpServerUtil.qm.dox.h:227
const DefaultTimeout
default timeout in ms
Definition: HttpServerUtil.qm.dox.h:84
abstract class that all HTTP dedicated socket handler objects must inherit from
Definition: HttpServerUtil.qm.dox.h:650
abstract class for HTTP request handlers anchored at a specific URL
Definition: HttpServerUtil.qm.dox.h:626
const LP_LEVELMASK
mask for the log level
Definition: HttpServerUtil.qm.dox.h:199
const HttpServerString
default HTTP server string
Definition: HttpServerUtil.qm.dox.h:81
the main namespace for the HttpServer and HttpServerUtil modules
Definition: HttpServerUtil.qm.dox.h:76
abstract logError(string fmt)
called to log error information to the registered error log code
logArgs(*softlist args)
calls log() with the given args
nothing http_set_reply_headers(Socket s, hash cx, reference rv, *string server_string)
helper function for setting HTTP response headers
string url_root
root part of URL for matching requests
Definition: HttpServerUtil.qm.dox.h:631
hash lsh
hash of listener stop flags
Definition: HttpServerUtil.qm.dox.h:661
any body
any message body given in a non-chunked request; could already be deserialized
Definition: HttpServerUtil.qm.dox.h:369