ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
stringify.php
Go to the documentation of this file.
1<?php
2
15
16// Find the autoloader
18 __DIR__ . '/../vendor/autoload.php',
19 __DIR__ . '/../../../autoload.php',
20 __DIR__ . '/vendor/autoload.php',
21
22];
23foreach ($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
38echo $request;
39echo "\r\n\r\n";
40
42$response->setHeaders([
43 'Content-Type' => 'text/plain',
44 'Connection' => 'close',
45 ]);
46
47$response->setBody("ABORT! ABORT!");
48
49echo $response;
50
51echo "\r\n";
$path
Definition: aliased.php:25
An exception for terminatinating execution or to throw for unit testing.
The Request class represents a single HTTP request.
Definition: Request.php:18
This class represents a single HTTP response.
Definition: Response.php:12
$paths
Definition: stringify.php:17
foreach($paths as $path) $request
Definition: stringify.php:30
$response
Definition: stringify.php:41