Sample code for 30+ languages & platforms
Perl

HTTP DELETE with Body

See more HTTP Examples

Demonstrates how to send a DELETE request with a body.

Chilkat Perl Downloads

Perl
use chilkat();

$success = 0;

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

$http = chilkat::CkHttp->new();

# Use the HttpStr method (or HttpSb) to send a DELETE request with a body.
$requestBody = "{ \"abc\": 123 }";
$resp = chilkat::CkHttpResponse->new();
$success = $http->HttpStr("DELETE","https://example.com/something",$requestBody,"utf-8","application/json",$resp);
if ($success == 0) {
    print $http->lastErrorText() . "\r\n";
    exit;
}

print "Response status: " . $resp->get_StatusCode() . "\r\n";
print "Response body: " . "\r\n";
print $resp->bodyStr() . "\r\n";