Skip to content
HTTPOverview

request

Provides the module's general HTTP request entry point.

Aliaseshttp_requesthttp.http_requesthttp.requesthttp.Requesthttprequestkrnl_requestsyn_requestwebrequest

Details#

Sends an HTTP request described by a table with Url, optional Method, Headers and Body. Inspect StatusCode and Body in the response; transport failures differ from an HTTP error status. The example requires a local HTTP server on port 8080.

Examples#

Example

Luau
local ok, response = pcall(request, {
    Url = "http://127.0.0.1:8080/",
    Method = "GET",
})
if ok then print(response.StatusCode, response.Body) else warn(response) end