PHP ActiveX
PHP ActiveX
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 ActiveX Downloads
<?php
$success = 0;
$http = new COM("Chilkat.Http");
$resp = new COM("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 == 0) {
print $http->LastErrorText . "\n";
exit;
}
print 'Response Status Code: ' . $resp->StatusCode . "\n";
print 'Response body:' . "\n";
print $resp->BodyStr . "\n";
?>