ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
client.php
Go to the documentation of this file.
1
<?
php
2
11
use
Sabre\HTTP\Client
;
12
use
Sabre\HTTP\Request
;
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');
34
$response
=
$client
->send(
$request
);
35
36
echo
"Response:\n"
;
37
38
echo
(
string
)
$response
;
$path
$path
Definition:
aliased.php:25
Sabre\HTTP\Request
The Request class represents a single HTTP request.
Definition:
Request.php:18
$request
foreach($paths as $path) $request
Definition:
client.php:30
$paths
$paths
Definition:
client.php:15
$response
$response
Definition:
client.php:34
Request
echo
Client
This example demonstrates the ability for clients to work asynchronously.
$client
$client
Definition:
client.php:32
php
Sabre\HTTP\Client
A rudimentary HTTP client.
Definition:
Client.php:44
libs
composer
vendor
sabre
http
examples
client.php
Generated on Thu Jan 16 2025 19:01:53 for ILIAS by
1.8.13 (using
Doxyfile
)