PHP
PHP
Send HTTPS Get Without Waiting for the Response
See more REST Examples
This example demonstrates sending an HTTP GET request without waiting for the response.Chilkat PHP Downloads
<?php
use Chilkat2\Rest;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
$rest = new Rest();
// Connect to the server using TLS
$bAutoReconnect = false;
try {
$rest->Connect('example.com', 443, true, $bAutoReconnect);
// Send a GET request to https://example.com/some/path
$rest->SendReqNoBody('GET', '/some/path');
} catch (\Chilkat2\Exception $e) {
echo $e->getMessage(), "\n";
exit;
}
// OK, the request was sent.
// Close the connection.
$maxWaitMs = 50;
$rest->Disconnect($maxWaitMs);
echo "GET Request Sent.\n";