Sample code for 30+ languages & platforms
PowerShell

HTTP DELETE with Body

See more HTTP Examples

Demonstrates how to send a DELETE request with a body.

Chilkat PowerShell Downloads

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

$success = $false

# This example assumes the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

$http = New-Object Chilkat.Http

# Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
$requestBody = "{ `"abc`": 123 }"
$resp = New-Object Chilkat.HttpResponse
$success = $http.HttpStr("DELETE","https://example.com/something",$requestBody,"utf-8","application/json",$resp)
if ($success -eq $false) {
    $($http.LastErrorText)
    exit
}

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