Sample code for 30+ languages & platforms
Chilkat2-Python

Transition from Http.PutBinary to Http.HttpBinary

Provides instructions for replacing deprecated PutBinary method calls with HttpBinary.

Chilkat Chilkat2-Python Downloads

Chilkat2-Python
import sys
import chilkat2

success = False

http = chilkat2.Http()

verb = "PUT"
url = "https://example.com/"

contentType = "application/octet-stream"

# ------------------------------------------------------------------------
# The PutBinary method is deprecated:

responseBody = http.PutBinary(url,byteData,contentType,False,False)
if (http.LastMethodSuccess == False):
    print(http.LastErrorText)
    sys.exit()

# ...
# ...

# ------------------------------------------------------------------------
# Do the equivalent using HttpBinary.

responseOut = chilkat2.HttpResponse()
success = http.HttpBinary(verb,url,byteData,contentType,responseOut)
if (success == False):
    print(http.LastErrorText)
    sys.exit()

responseBody = responseOut.BodyStr