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

Transition from Http.PutText to Http.HttpStr

Provides instructions for replacing deprecated PutText method calls with HttpStr.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cVerb
LOCAL cUrl
LOCAL cTextData
LOCAL cCharset
LOCAL cContentType
LOCAL cResponseBody
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 PutText method is deprecated:

cResponseBody := oHttp:PutText(cUrl, cTextData, cCharset, cContentType, 0, 0)
IF (oHttp:LastMethodSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    RETURN
ENDIF

//  ...
//  ...

//  ------------------------------------------------------------------------
//  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

cResponseBody := oResponseOut:BodyStr

oHttp:destroy()
oResponseOut:destroy()