Sample code for 30+ languages & platforms
Xbase++ Requires Chilkat v11.0.0+

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 Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cXmlStr
LOCAL cUrlEndpoint
LOCAL cXmlCharset
LOCAL oResp

nSuccess := 0

//  This example assumes the Chilkat API to have been previously unlocked.
//  See Global Unlock Sample for sample code.

oHttp := CreateObject("Chilkat.Http")

//  XML to send in the body of the HTTPS POST
cXmlStr := "..."

cUrlEndpoint := "https://apicert.sii.cl/recursos/v1/boleta.electronica.token"
cXmlCharset := "utf-8"

oResp := CreateObject("Chilkat.HttpResponse")
nSuccess := oHttp:HttpStr("POST", cUrlEndpoint, cXmlStr, "utf-8", "application/xml", oResp)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oResp:destroy()
    RETURN
ENDIF

//  Get the response status code and body
? "response status code = " + Str(oResp:StatusCode)

//  This would be the XML response sent by the server.
? oResp:BodyStr

oHttp:destroy()
oResp:destroy()