Classes
c_web_client

c_web_client

Functions

get

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
returnsc_response
local web_client = c_web_client.new()
 
local response = web_client:get(
    "https://example.com",
    {
        useragent = "useragent",
        headers = {{"content-type", "application/json"}},
        timeout = 30 --[[ 30 seconds --]]
    }
)
 
local json_table = response:json()

async_get

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
callbackfunction(response: c_response)
returnsc_response
local web_client = c_web_client.new()
 
web_client:async_get("https://example.com", {}, function(response)
    local json_table = response:json()
end)

post

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
returnsc_response

async_post

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
callbackfunction(response: c_response)
returnsc_response

put

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
returnsc_response

async_put

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
callbackfunction(response: c_response)
returnsc_response

delete

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
returnsc_response

async_delete

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
callbackfunction(response: c_response)
returnsc_response

patch

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
returnsc_response

async_patch

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
callbackfunction(response: c_response)
returnsc_response

head

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
returnsc_response

async_head

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
callbackfunction(response: c_response)
returnsc_response

options

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
returnsc_response

async_options

ArgumentTypeRequired
urlstring
options{timeout: number | nil, body: string | table | nil, useragent: string | nil, headers: table | nil }
callbackfunction(response: c_response)
returnsc_response