1<?php
2
3/**
4 * This example shows how to make a HTTP request with the Request and Response
5 * objects.
6 *
7 * @copyright Copyright (C) 2009-2015 fruux GmbH (https://fruux.com/).
8 * @author Evert Pot (http://evertpot.com/)
9 * @license http://sabre.io/license/ Modified BSD License
10 */
11use Sabre\HTTP\Request;
12use Sabre\HTTP\Client;
13
14// Find the autoloader
15$paths = [
16    __DIR__ . '/../vendor/autoload.php',
17    __DIR__ . '/../../../autoload.php',
18    __DIR__ . '/vendor/autoload.php',
19
20];
21
22foreach ($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
36echo "Response:\n";
37
38echo (string)$response;
39