(AutoIt) POST XML to https://apicert.sii.cl/recursos/v1/boleta.electronica.token
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.
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
; XML to send in the body of the HTTPS POST
Local $sXmlStr = "..."
Local $sUrlEndpoint = "https://apicert.sii.cl/recursos/v1/boleta.electronica.token"
Local $sXmlCharset = "utf-8"
Local $oResp = $oHttp.PostXml($sUrlEndpoint,$sXmlStr,$sXmlCharset)
If ($oHttp.LastMethodSuccess <> True) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
; Get the response status code and body
ConsoleWrite("response status code = " & $oResp.StatusCode & @CRLF)
; This would be the XML response sent by the server.
ConsoleWrite($oResp.BodyStr & @CRLF)
|