Module jls.net.http.HttpContext

The HttpContext class maps a path to a handler.

Class HttpContext

HttpContext:new (path, handler[, attributes]) Creates a new Context.
httpContext:getArguments (path) Returns the captured values of the specified path.


Class HttpContext

The HttpContext class maps a path to a handler. The HttpContext is used by the HttpServer through the HttpContextHolder.
HttpContext:new (path, handler[, attributes])
Creates a new Context. The handler will be called when the request headers have been received if specified. The handler will be called when the body has been received if no response has been set.

Parameters:

  • path string the context path
  • handler function the context handler the function takes one argument which is an HttpExchange.
  • attributes table the optional context attributes (optional)
httpContext:getArguments (path)
Returns the captured values of the specified path.

Parameters:

  • path

Returns:

    string the first captured value, nil if there is no captured value.
generated by LDoc 1.4.6 Last updated 2022-01-22 16:32:56