Visual FoxPro
Visual FoxPro
Transition from Http.PFile to Http.HttpFile
Provides instructions for replacing deprecated PFile method calls with HttpFile.Chilkat Visual FoxPro Downloads
LOCAL lnSuccess
LOCAL loHttp
LOCAL lcVerb
LOCAL lcUrl
LOCAL lcLocalFilePath
LOCAL lcContentType
LOCAL loResponseObj
LOCAL loResponseOut
lnSuccess = 0
loHttp = CreateObject('Chilkat.Http')
lcVerb = "POST"
lcUrl = "https://example.com/"
lcLocalFilePath = "c:/temp/requestBodyContent.dat"
lcContentType = "application/octet-stream"
* ------------------------------------------------------------------------
* The PFile method is deprecated:
loResponseObj = loHttp.PFile(lcVerb,lcUrl,lcLocalFilePath,lcContentType,0,0)
IF (loHttp.LastMethodSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
CANCEL
ENDIF
* ...
* ...
RELEASE loResponseObj
* ------------------------------------------------------------------------
* Do the equivalent using HttpFile.
* Your application creates a new, empty HttpResponse object which is passed
* in the last argument and filled upon success.
loResponseOut = CreateObject('Chilkat.HttpResponse')
lnSuccess = loHttp.HttpFile(lcVerb,lcUrl,lcLocalFilePath,lcContentType,loResponseOut)
IF (lnSuccess = 0) THEN
? loHttp.LastErrorText
RELEASE loHttp
RELEASE loResponseOut
CANCEL
ENDIF
RELEASE loHttp
RELEASE loResponseOut