Ruby
Ruby
Transition from Http.PBinaryBd to Http.HttpBd
Provides instructions for replacing deprecated PBinaryBd method calls with HttpBd.Chilkat Ruby Downloads
require 'chilkat'
success = false
http = Chilkat::CkHttp.new()
verb = "POST"
url = "https://example.com/"
bdRequestBody = Chilkat::CkBinData.new()
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() + "\n";
exit
end
# ...
# ...
# ------------------------------------------------------------------------
# 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.new()
success = http.HttpBd(verb,url,bdRequestBody,contentType,responseOut)
if (success == false)
print http.lastErrorText() + "\n";
exit
end