ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
stringify.php
Go to the documentation of this file.
1
<?
php
2
13
use
Sabre\HTTP\Request
;
14
use
Sabre\HTTP\Response
;
15
16
// Find the autoloader
17
$paths
= [
18
__DIR__ .
'/../vendor/autoload.php'
,
19
__DIR__ .
'/../../../autoload.php'
,
20
__DIR__ .
'/vendor/autoload.php'
,
21
22
];
23
foreach
(
$paths
as
$path
) {
24
if
(file_exists(
$path
)) {
25
include
$path
;
26
break
;
27
}
28
}
29
30
$request
=
new
Request
(
'POST'
,
'/foo'
);
31
$request
->setHeaders([
32
'Host'
=>
'example.org'
,
33
'Content-Type'
=>
'application/json'
34
]);
35
36
$request
->setBody(json_encode([
'foo'
=>
'bar'
]));
37
38
echo
$request
;
39
echo
"\r\n\r\n"
;
40
41
$response
=
new
Response
(424);
42
$response
->setHeaders([
43
'Content-Type'
=>
'text/plain'
,
44
'Connection'
=>
'close'
,
45
]);
46
47
$response
->setBody(
"ABORT! ABORT!"
);
48
49
echo
$response
;
50
51
echo
"\r\n"
;
$path
$path
Definition:
aliased.php:25
php
An exception for terminatinating execution or to throw for unit testing.
Sabre\HTTP\Request
The Request class represents a single HTTP request.
Definition:
Request.php:18
Sabre\HTTP\Response
This class represents a single HTTP response.
Definition:
Response.php:12
$paths
$paths
Definition:
stringify.php:17
$request
foreach($paths as $path) $request
Definition:
stringify.php:30
$response
$response
Definition:
stringify.php:41
libs
composer
vendor
sabre
http
examples
stringify.php
Generated on Thu Oct 2 2025 19:01:16 for ILIAS by
1.9.4 (using
Doxyfile
)