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

Transition from Http.PostXml to Http.HttpStr

Provides instructions for replacing deprecated PostXml method calls with HttpStr.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cUrl
LOCAL cRequestBodyXml
LOCAL cCharset
LOCAL oResponseObj
LOCAL oResponseOut

nSuccess := 0

oHttp := CreateObject("Chilkat.Http")

cUrl := "https://example.com/something"
cRequestBodyXml := "<something>...</something>"
cCharset := "utf-8"

//  ------------------------------------------------------------------------
//  The PostXml method is deprecated:

oResponseObj := oHttp:PostXml(cUrl, cRequestBodyXml, cCharset)
IF (oHttp:LastMethodSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    RETURN
ENDIF

//  ...
//  ...

oResponseObj:destroy()

//  ------------------------------------------------------------------------
//  Do the equivalent using HttpStr.
//  Your application creates a new, empty HttpResponse object which is passed 
//  in the last argument and filled upon success.

oResponseOut := CreateObject("Chilkat.HttpResponse")
nSuccess := oHttp:HttpStr("POST", cUrl, cRequestBodyXml, cCharset, "application/xml", oResponseOut)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oResponseOut:destroy()
    RETURN
ENDIF

oHttp:destroy()
oResponseOut:destroy()