ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
client.php
Go to the documentation of this file.
1 <?php
2 
13 
14 // Find the autoloader
15 $paths = [
16  __DIR__ . '/../vendor/autoload.php',
17  __DIR__ . '/../../../autoload.php',
18  __DIR__ . '/vendor/autoload.php',
19 
20 ];
21 
22 foreach ($paths as $path) {
23  if (file_exists($path)) {
24  include $path;
25  break;
26  }
27 }
28 
29 // Constructing the request.
30 $request = new Request('GET', 'http://localhost/');
31 
32 $client = new Client();
33 //$client->addCurlSetting(CURLOPT_PROXY,'localhost:8888');
35 
36 echo "Response:\n";
37 
38 echo (string)$response;
$path
Definition: aliased.php:25
The Request class represents a single HTTP request.
Definition: Request.php:18
foreach($paths as $path) $request
Definition: client.php:30
$paths
Definition: client.php:15
$response
Definition: client.php:34
This example demonstrates the ability for clients to work asynchronously.
$client
Definition: client.php:32
A rudimentary HTTP client.
Definition: Client.php:44