Sample code for 30+ languages & platforms
PowerShell

Example: Http.HttpNoBody method

Demonstrates how to use the HttpNoBody method to send HTTP requests without a request body (e.g., GET, DELETE, HEAD) and receive the response in a Chilkat Http response object.

Chilkat PowerShell Downloads

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

$success = $false

$http = New-Object Chilkat.Http
$resp = New-Object Chilkat.HttpResponse

# Send a DELETE request to https://api.example.com/users/123
$url = "https://api.example.com/users/123"
$success = $http.HttpNoBody("DELETE",$url,$resp)
if ($success -eq $false) {
    $($http.LastErrorText)
    exit
}

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