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

Transition from Http.PFile to Http.HttpFile

Provides instructions for replacing deprecated PFile method calls with HttpFile.

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL cVerb
LOCAL cUrl
LOCAL cLocalFilePath
LOCAL cContentType
LOCAL oResponseObj
LOCAL oResponseOut

nSuccess := 0

oHttp := CreateObject("Chilkat.Http")

cVerb := "POST"
cUrl := "https://example.com/"
cLocalFilePath := "c:/temp/requestBodyContent.dat"
cContentType := "application/octet-stream"

//  ------------------------------------------------------------------------
//  The PFile method is deprecated:

oResponseObj := oHttp:PFile(cVerb, cUrl, cLocalFilePath, cContentType, 0, 0)
IF (oHttp:LastMethodSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    RETURN
ENDIF

//  ...
//  ...

oResponseObj:destroy()

//  ------------------------------------------------------------------------
//  Do the equivalent using HttpFile.
//  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:HttpFile(cVerb, cUrl, cLocalFilePath, cContentType, oResponseOut)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oResponseOut:destroy()
    RETURN
ENDIF

oHttp:destroy()
oResponseOut:destroy()