PHP Extension
PHP Extension
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 PHP Extension Downloads
<?php
include("chilkat.php");
$success = false;
$http = new CkHttp();
$resp = new CkHttpResponse();
// 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 == false) {
print $http->lastErrorText() . "\n";
exit;
}
print 'Response Status Code: ' . $resp->get_StatusCode() . "\n";
print 'Response body:' . "\n";
print $resp->bodyStr() . "\n";
?>