Qore HttpServerUtil Module Reference  0.3.11.1
HttpServer Namespace Reference

the main namespace for the HttpServer and HttpServerUtil modules More...

Classes

class  AbstractAuthenticator
 abstract base class for external authentication More...
 
class  AbstractHttpRequestHandler
 abstract class that all HTTP request handler objects must inherit from More...
 
class  AbstractHttpSocketHandler
 abstract class that all HTTP dedicated socket handler objects must inherit from More...
 
class  AbstractLogger
 this abstract class defines the interface for classes that provide logging methods More...
 
class  AbstractStreamRequest
 abstract class for streaming HTTP chunked requests/responses More...
 
class  AbstractUrlHandler
 abstract class for HTTP request handlers anchored at a specific URL More...
 
class  HttpListenerInterface
 this abstract class defines the public interface of the private HttpListener class defined in the HttpServer module More...
 
class  PermissiveAuthenticator
 class providing automatic authentication for all requests More...
 

Functions

string http_get_url_from_bind (softstring bind, *string host)
 returns a complete URL from a bind address More...
 
nothing http_set_reply_headers (Socket s, hash cx, reference rv, *string server_string)
 helper function for setting HTTP response headers
 
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 first "?" character, and arguments are after More...
 

Variables

const DefaultTimeout = 30s
 default timeout in ms
 
const HttpCodes
 map of HTTP result codes and text messages
 
const HttpServerString = sprintf("Qore-HTTP-Server/%s", HttpServerVersion)
 default HTTP server string
 
const HttpServerVersion = "0.3.11.1"
 version of the HttpServer's implementation
 
const LP_LEVELMASK = LP_LOGPARAMS - 1
 mask for the log level
 
const LP_LOGPARAMS = 1 << 16
 bit for logging argument
 
const ReadTimeout = DefaultTimeout
 read timeout in ms
 

Detailed Description

the main namespace for the HttpServer and HttpServerUtil modules

To use this module, use "%requires HttpServerUtil" in your code.

All the public symbols in the module are defined in this namespace

Function Documentation

◆ http_get_url_from_bind()

string HttpServer::http_get_url_from_bind ( softstring  bind,
*string  host 
)

returns a complete URL from a bind address

Parameters
bindthe bind address; if for any reason there is a path in the bind address, it will be ignored
hostthe hostname to use in case the bind string is only a port number; if none is passed or the value passed is equal to the return value of Qore::gethostname(), then "localhost" is used

◆ parse_uri_query()

hash HttpServer::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 first "?" character, and arguments are after

Parameters
paththe URI path to parse
Returns
a hash with the following keys:
  • method: (string) the part of the path before the first "?" character or the entire path if no "?" character is present in the path
  • params: (hash) optional, only if a "?" character is present in the input; the part of the path after the first "?" character; arguments should be separated by ";" characters (according to a w3c recommendation: http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2), however this function supports both ";" and "&" as argument separators; if the arguments are not key=value, then each element without a value is assigned True
Since
0.3.11 the params key value is always returned as a hash