PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Sebastian Potasiak   Silhouette HTTP   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example use of Silhouette Http
Class: Silhouette HTTP
Process HTTP response for a request
Author: By
Last change:
Date: 11 years ago
Size: 631 bytes
 

Contents

Class file image Download
<?php

use \src\Silhouette\Http\Request;
use \
src\Silhouette\Http\Response;

include
'src/Silhouette/Http/HeadersManagementAbstract.php';
include
'src/Silhouette/Http/RequestInterface.php';
include
'src/Silhouette/Http/ResponseInterfaceAbstract.php';
include
'src/Silhouette/Http/Request.php';
include
'src/Silhouette/Http/Response.php';

// Create request instance from current session
$Request = Request::createFromGlobals();

// Show HTTP request contents
print $Request->__toString();

// Create response instance
$Response = new Response();
$Response->message = 'This works!';

print
$Response->recieve();