PHP code example of parable-php / http

1. Go to this page and download the library: Download parable-php/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/ */

    

parable-php / http example snippets


$request = RequestFactory::createFromServer();

$request = new Request(
    'GET', 
    'http://url.here/path?param=value'
);

$response = new Response(200, 'This is the body');

$response = new Response(200, 'This is the body');
$dispatcher = new Dispatcher();

$dispatcher->dispatch($response);