Xbase++ Requires Chilkat v11.0.0+
Xbase++
Transition from Http.QuickRequestParams to Http.HttpParams
Provides instructions for replacing deprecated QuickRequestParams method calls with HttpParams.Chilkat Xbase++ Downloads
LOCAL nSuccess
LOCAL oHttp
LOCAL cVerb
LOCAL cUrl
LOCAL oJson
LOCAL oResponseObj
LOCAL oResponseOut
nSuccess := 0
oHttp := CreateObject("Chilkat.Http")
cVerb := "GET"
cUrl := "https://example.com/"
oJson := CreateObject("Chilkat.JsonObject")
oJson:UpdateInt("param1", 100)
oJson:UpdateString("param2", "test")
// ------------------------------------------------------------------------
// The QuickRequestParams method is deprecated:
oResponseObj := oHttp:QuickRequestParams(cVerb, cUrl, oJson)
IF (oHttp:LastMethodSuccess == 0)
? oHttp:LastErrorText
oHttp:destroy()
oJson:destroy()
RETURN
ENDIF
// ...
// ...
oResponseObj:destroy()
// ------------------------------------------------------------------------
// Do the equivalent using HttpParams.
// 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:HttpParams(cVerb, cUrl, oJson, oResponseOut)
IF (nSuccess == 0)
? oHttp:LastErrorText
oHttp:destroy()
oJson:destroy()
oResponseOut:destroy()
RETURN
ENDIF
oHttp:destroy()
oJson:destroy()
oResponseOut:destroy()