Sample code for 30+ languages & platforms
PowerShell

Example: Http.HttpBinary method

Demonstrates the HttpBinary method.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

$localFilePath = "C:/example/zips/data.zip"

$bd = New-Object Chilkat.BinData
$success = $bd.LoadFile($localFilePath)
if ($success -eq $false) {
    $($bd.LastErrorText)
    exit
}

$zipBytes = $bd.GetData()

$url = "https://example.com/api/v1/sites/123/deploys"

# Send a POST with a binary HTTP request body.
$resp = New-Object Chilkat.HttpResponse
$http = New-Object Chilkat.Http

$success = $http.HttpBinary("POST",$url,$zipBytes,"application/zip",$resp)
if ($success -eq $false) {
    $($http.LastErrorText)
    exit
}

$("Response Status Code: " + $resp.StatusCode)
$("Response body:")
$($resp.BodyStr)