105 "101":
"Switching Protocols",
114 "203":
"Non-Authoritative Information",
116 "205":
"Reset Content",
117 "206":
"Partial Content",
120 "207":
"Multi-Status",
123 "208":
"Already Reported",
129 "300":
"Multiple Choices",
130 "301":
"Moved Permanently",
133 "304":
"Not Modified",
136 "307":
"Temporary Redirect",
139 "400":
"Bad Request",
140 "401":
"Unauthorized",
141 "402":
"Payment Required",
144 "405":
"Method Not Allowed",
145 "406":
"Not Acceptable",
146 "407":
"Proxy Authentication Required",
147 "408":
"Request Timeout",
150 "411":
"Length Required",
151 "412":
"Precondition Failed",
152 "413":
"Request Entity Too Large",
153 "414":
"Request-URI Too Long",
154 "415":
"Unsupported Media Type",
155 "416":
"Requested Range Not Satisfiable",
156 "417":
"Expectation Failed",
159 "418":
"I'm a teapot",
162 "420":
"Enhance Yextern Calm",
165 "422":
"Unprocessable Entity",
171 "424":
"Failed Dependency",
174 "425":
"Unordered Collection",
177 "426":
"Upgrade Required",
180 "428":
"Precondition Required",
183 "429":
"Too Many Requests",
186 "431":
"Request Header Fields Too Large",
189 "500":
"Internal Server Error",
190 "501":
"Not Implemented",
191 "502":
"Bad Gateway",
192 "503":
"Service Unavailable",
193 "504":
"Gateway Timeout",
194 "505":
"HTTP Version Not Supported",
195 "509":
"Bandwidth Limit Exceeded",
198 "510":
"Not Extended",
201 "511":
"Network Authentication Required",
310 abstract log(
string fmt);
315 abstract logError(
string fmt);
320 logArgs(*softlist args);
326 logErrorArgs(*softlist args);
337 abstract addUserThreadContext(
hash uctx);
342 abstract auto removeUserThreadContext(*
string k);
354 bool requiresAuthentication();
370 authenticate(
string user,
string pass =
"");
380 authenticateByIP(
string ip, reference<string> user);
385 hash getAuthHeader();
392 hash<HttpResponseInfo> do401(
string msg =
"Authentication is required to access this server");
492 hash<HttpHandlerResponseInfo> handleRequest();
503 hash<HttpHandlerResponseInfo> sendResponse();
519 hash<HttpHandlerResponseInfo> getResponseHeaderMessage();
528 nothing recv(
hash v);
551 logChunk(
bool send,
int size);
569 hash<HttpResponseInfo> getResponseHeaderMessageImpl();
585 nothing recvImpl(
hash v);
619 bool decompress_to_string =
True;
628 const NotificationThreadKey =
"_AHRH_pc";
631 const PersistenceThreadKey =
"_AHRH_p";
647 setPersistent(
bool p =
True);
651 notifyClosed(*
code c);
659 string maskData(
string msg);
663 static staticNotificationCleanup();
666 static staticPersistenceCleanup();
669 nothing persistentClosed();
720 static data decodeBody(
string ce,
binary body, *
string enc);
723 static binary encodeBody(
string ce, data
body);
726 *data getMessageBody(Socket s,
hash hdr, *data
body,
bool decode =
True);
746 static *
string getLogMessage(
hash cx,
hash api, reference params, *reference<string> args);
751 *
hash saveThreadLocalData();
757 restoreThreadLocalData(*
hash data);
761 static hash<HttpResponseInfo> makeResponse(
int code,
string fmt);
764 static hash<HttpResponseInfo> makeResponse(
hash hdr,
int code,
string fmt);
767 static hash<HttpResponseInfo> makeResponse(
int code, *data
body, *
hash hdr);
770 static hash<HttpResponseInfo> make400(
string fmt);
773 static hash<HttpResponseInfo> make400(
hash hdr,
string fmt);
776 static hash<HttpResponseInfo> make501(
string fmt);
779 static hash<HttpResponseInfo> make501(
hash hdr,
string fmt);
782 static hash<HttpResponseInfo> redirect(
hash cx,
hash hdr,
string path);
803 string getRelativePath(
string path);
851 start(softstring lid,
hash cx,
hash hdr, Socket s);
859 stop(softstring lid);
918 abstract startImpl(softstring lid,
hash cx,
hash hdr, Socket s);
926 stopImpl(
string lid);
softbool close
set this key to True if the connection should be unconditionally closed when the handler returns ...
Definition: HttpServerUtil.qm.dox.h:223
bool reply_sent
this key can be set to True if the reply has already been sent (by a chunked callback for example) ...
Definition: HttpServerUtil.qm.dox.h:229
string sprintf(string fmt,...)
hash hdr
a hash of request headers
Definition: HttpServerUtil.qm.dox.h:469
const ReadTimeout
read timeout in ms
Definition: HttpServerUtil.qm.dox.h:99
const HttpCodes
map of HTTP result codes and text messages
Definition: HttpServerUtil.qm.dox.h:102
abstract class for streaming HTTP chunked requests/responses
Definition: HttpServerUtil.qm.dox.h:452
const LP_LOGPARAMS
bit for logging argument
Definition: HttpServerUtil.qm.dox.h:208
abstract class that all HTTP request handler objects must inherit from
Definition: HttpServerUtil.qm.dox.h:608
class providing automatic authentication for all requests
Definition: HttpServerUtil.qm.dox.h:420
*AbstractAuthenticator auth
the optional AbstractAuthenticator for requests to this handler
Definition: HttpServerUtil.qm.dox.h:613
hash lh
hash of listener references; this is to stop all connections associated with a particular listener ...
Definition: HttpServerUtil.qm.dox.h:818
*hash hdr
set this key to a hash of extra header information to be returned with the response ...
Definition: HttpServerUtil.qm.dox.h:226
this abstract class defines the public interface of the private HttpListener class defined in the Htt...
Definition: HttpServerUtil.qm.dox.h:331
string http_mask_data(string msg)
this function can be used to mask data in log messages
AbstractHttpRequestHandler handler
the request handler for the request
Definition: HttpServerUtil.qm.dox.h:463
string errlog
a string can be returned here which will be logged in the HTTP server's error log file (if any) ...
Definition: HttpServerUtil.qm.dox.h:235
bool stream
if the handler supports streaming requests/responses with chunked data
Definition: HttpServerUtil.qm.dox.h:622
string errlog
a string can be returned here which will be logged in the HTTP server's error log file (if any) ...
Definition: HttpServerUtil.qm.dox.h:259
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:348
hash cx
the call context variable
Definition: HttpServerUtil.qm.dox.h:467
Socket s
the Socket object for the response
Definition: HttpServerUtil.qm.dox.h:465
const HttpServerVersion
version of the HttpServer's implementation
Definition: HttpServerUtil.qm.dox.h:90
*data body
the message body to return in the response; if this key is returned, then the reply is sent immediate...
Definition: HttpServerUtil.qm.dox.h:220
*hash hdr
set this key to a hash of extra header information to be returned with the response ...
Definition: HttpServerUtil.qm.dox.h:250
HttpListenerInterface listener
an HttpListenerInterface object for the listener serving the request for logging purposes ...
Definition: HttpServerUtil.qm.dox.h:461
this abstract class defines the interface for classes that provide logging methods ...
Definition: HttpServerUtil.qm.dox.h:304
auto body
any message body given in a non-chunked request; could already be deserialized
Definition: HttpServerUtil.qm.dox.h:471
int code
the HTTP return code (see HttpServer::HttpCodes for possible values)
Definition: HttpServerUtil.qm.dox.h:241
const DefaultTimeout
default timeout in ms
Definition: HttpServerUtil.qm.dox.h:96
string log
a string can be returned here which will be logged in the HTTP server's log file (if any) ...
Definition: HttpServerUtil.qm.dox.h:256
int code
the HTTP return code (see HttpServer::HttpCodes for possible values)
Definition: HttpServerUtil.qm.dox.h:217
abstract class that all HTTP dedicated socket handler objects must inherit from
Definition: HttpServerUtil.qm.dox.h:810
abstract class for HTTP request handlers anchored at a specific URL
Definition: HttpServerUtil.qm.dox.h:786
the return value of HTTP handler methods with potentially unserialized message bodies ...
Definition: HttpServerUtil.qm.dox.h:239
hash< Util::UriQueryInfo > 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...
const LP_LEVELMASK
mask for the log level
Definition: HttpServerUtil.qm.dox.h:211
const HttpServerString
default HTTP server string
Definition: HttpServerUtil.qm.dox.h:93
the main namespace for the HttpServer and HttpServerUtil modules
Definition: HttpServerUtil.qm.dox.h:88
the return value of HTTP handler methods where any message body has been serialized for sending over ...
Definition: HttpServerUtil.qm.dox.h:215
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:791
auto body
the message body to return in the response; for higher-level handlers this can be any data type that ...
Definition: HttpServerUtil.qm.dox.h:244
hash lsh
hash of listener stop flags
Definition: HttpServerUtil.qm.dox.h:821
string log
a string can be returned here which will be logged in the HTTP server's log file (if any) ...
Definition: HttpServerUtil.qm.dox.h:232