1. Go to this page and download the library: Download geggleto/http library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
geggleto / http example snippets
use Http\Request;
$request = new Request($_GET, $_POST, $_COOKIE, $_FILES, $_SERVER);
use Http\Request;
use Http\Response;
use Http\CookieBuilder;
$loader = is only an example
$cookieBuilder->setDefaultSecure(false);
$request = new Request($_GET, $_POST, $_COOKIE, $_FILES, $_SERVER);
$response = new Response;
$content = '<h1>Hello World</h1>';
$content .= $request->getCookie('TestCookie', 'Cookie is not set.');
if ($request->getParameter('setCookie') === 'true') {
$cookie = $cookieBuilder->build('TestCookie', 'Cookie is set.');
$response->addCookie($cookie);
}
$response->setContent($content);
foreach ($response->getHeaders() as $header) {
header($header);
}
echo $response->getContent();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.