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

Transition from Http.PBinaryBd to Http.HttpBd

Provides instructions for replacing deprecated PBinaryBd method calls with HttpBd.

Chilkat Lianja Downloads

Lianja
llSuccess = .F.

loHttp = createobject("CkHttp")

lcVerb = "POST"
lcUrl = "https://example.com/"
loBdRequestBody = createobject("CkBinData")
lcContentType = "application/octet-stream"

//  ------------------------------------------------------------------------
//  The PBinaryBd method is deprecated:

loResponseObj = loHttp.PBinaryBd(lcVerb,lcUrl,loBdRequestBody,lcContentType,.F.,.F.)
if (loHttp.LastMethodSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loBdRequestBody
    return
endif

//  ...
//  ...

release loResponseObj

//  ------------------------------------------------------------------------
//  Do the equivalent using HttpBd.
//  Your application creates a new, empty HttpResponse object which is passed 
//  in the last argument and filled upon success.

loResponseOut = createobject("CkHttpResponse")
llSuccess = loHttp.HttpBd(lcVerb,lcUrl,loBdRequestBody,lcContentType,loResponseOut)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loBdRequestBody
    release loResponseOut
    return
endif



release loHttp
release loBdRequestBody
release loResponseOut