Skip to content

httpPost

Performs a synchronous HTTP POST request.

Syntax

lua
Ham.httpPost(url, payload, headers, insecure)

Parameters

NameTypeDescription
urlstringURL to request
payloadstringRequest body
headerstable|nilOptional headers table
insecureboolean|nilSkip SSL verification (optional)

Returns

  • table - Response table (same as httpGet)

Example

lua
local response = Ham.httpPost("https://api.example.com/submit", 
    '{"key": "value"}',
    {["Content-Type"] = "application/json"}
)

See Also

Released under the ISC License.