Lua Requires Chilkat v11.0.0+
Lua
POST XML to https://apicert.sii.cl/recursos/v1/boleta.electronica.token
See more HTTP Misc Examples
Demonstrates how to send an HTTPS POST XML request to POST XML to https://apicert.sii.cl/recursos/v1/boleta.electronica.token and retrieve the response.Chilkat Lua Downloads
local chilkat = require("chilkat")
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
local http = chilkat.Http.new()
-- XML to send in the body of the HTTPS POST
local xmlStr = "..."
local urlEndpoint = "https://apicert.sii.cl/recursos/v1/boleta.electronica.token"
local xmlCharset = "utf-8"
local resp = chilkat.HttpResponse.new()
local success = http:http_str("POST", urlEndpoint, xmlStr, "utf-8", "application/xml", resp)
if not success then
print(http.last_error_text)
return
end
-- Get the response status code and body
print("response status code = " .. resp.status_code)
-- This would be the XML response sent by the server.
print(resp.body_str)