Xbase++ Requires Chilkat v11.0.0+
Xbase++
Transition from Http.PText to Http.HttpStr
Provides instructions for replacing deprecated PText method calls with HttpStr.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oHttp
LOCAL cVerb
LOCAL cUrl
LOCAL cTextData
LOCAL cCharset
LOCAL cContentType
LOCAL oResponseObj
LOCAL oResponseOut
nSuccess := 0
oHttp := CreateObject("Chilkat.Http")
cVerb := "PUT"
cUrl := "https://example.com/"
cTextData := "This is the HTTP request body"
cCharset := "utf-8"
cContentType := "text/plain"
// ------------------------------------------------------------------------
// The PText method is deprecated:
oResponseObj := oHttp:PText(cVerb, cUrl, cTextData, cCharset, cContentType, 0, 0)
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(cVerb, cUrl, cTextData, cCharset, cContentType, oResponseOut)
IF (nSuccess == 0)
? oHttp:LastErrorText
oHttp:destroy()
oResponseOut:destroy()
RETURN
ENDIF
oHttp:destroy()
oResponseOut:destroy()