PowerShell
PowerShell
Transition from Http.PBinaryBd to Http.HttpBd
Provides instructions for replacing deprecated PBinaryBd method calls with HttpBd.Chilkat PowerShell Downloads
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"
$success = $false
$http = New-Object Chilkat.Http
$verb = "POST"
$url = "https://example.com/"
$bdRequestBody = New-Object Chilkat.BinData
$contentType = "application/octet-stream"
# ------------------------------------------------------------------------
# The PBinaryBd method is deprecated:
$responseObj = $http.PBinaryBd($verb,$url,$bdRequestBody,$contentType,$false,$false)
if ($http.LastMethodSuccess -eq $false) {
$($http.LastErrorText)
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 = New-Object Chilkat.HttpResponse
$success = $http.HttpBd($verb,$url,$bdRequestBody,$contentType,$responseOut)
if ($success -eq $false) {
$($http.LastErrorText)
exit
}