LuaHttpRequest:new
The constructor for a LuaHttpRequest
object (creates a new LuaHttpRequest
).
Syntax
LuaHttpRequest:new( config, section )
Arguments
Argument | Description |
---|---|
config
|
(LuaConfig) The LuaConfig object that contains the settings for sending the HTTP request. To obtain a LuaConfig object, see the function get_config or LuaConfig:new. |
section
|
(string) The name of the configuration section from which to read the settings. |
Returns
(LuaHttpRequest). The new LuaHttpRequest
object.
Example
The following example creates a new LuaHttpRequest
object by reading configuration settings from a string that is defined in the script:
local config_string = [===[ [HTTP] ProxyHost=proxy.domain.com ProxyPort=8080 SSLMethod=NEGOTIATE ]===] local config = LuaConfig:new(config_string) local request = LuaHttpRequest:new(config, "HTTP")