Sample code for 30+ languages & platforms
CkPython

Transition from Http.PBinaryBd to Http.HttpBd

Provides instructions for replacing deprecated PBinaryBd method calls with HttpBd.

Chilkat CkPython Downloads

CkPython
import sys
import chilkat

success = False

http = chilkat.CkHttp()

verb = "POST"
url = "https://example.com/"
bdRequestBody = chilkat.CkBinData()
contentType = "application/octet-stream"

# ------------------------------------------------------------------------
# The PBinaryBd method is deprecated:

# responseObj is a CkHttpResponse
responseObj = http.PBinaryBd(verb,url,bdRequestBody,contentType,False,False)
if (http.get_LastMethodSuccess() == False):
    print(http.lastErrorText())
    sys.exit()

# ...
# ...

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

responseOut = chilkat.CkHttpResponse()
success = http.HttpBd(verb,url,bdRequestBody,contentType,responseOut)
if (success == False):
    print(http.lastErrorText())
    sys.exit()