Module jls.net.http.HttpContextHolder
A class that holds HTTP contexts.
Class HttpContextHolder
HttpContextHolder:new () | Creates a new ContextHolder. |
httpContextHolder:createContext (path, handler[, attributes]) | Creates a context in this server with the specified path and using the specified handler. |
Class HttpContextHolder
A class that holds HTTP contexts.
- HttpContextHolder:new ()
- Creates a new ContextHolder.
- httpContextHolder:createContext (path, handler[, attributes])
-
Creates a context in this server with the specified path and using the specified handler.
The path is a Lua pattern that match the full path, take care of escaping the magic characters ^$()%.[]*+-?.
You could use the jls.util.strings.escape() function.
The path is absolute and starts with a slash '/'.
Parameters:
- path string The path of the context.
- handler The handler or a handler function. The function takes one argument which is the HttpExchange and will be called when the body is available.
- attributes table the optional context attributes (optional)
Returns:
-
the new context