Sample code for 30+ languages & platforms
Perl

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 Perl Downloads

Perl
use chilkat();

$success = 0;

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

# 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 == 0) {
    print $http->lastErrorText() . "\r\n";
    exit;
}

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