PHP code example of ft / request-response

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

    

ft / request-response example snippets


$req = new Request;

$resp = new Response();

$resp = new Response();
$resp->statusCode(StatusCodes::HTTP_VERSION_NOT_SUPPORTED)
     ->send();

$array = [
    'foo' => 'bar'
];
$resp = new Response();
$resp->sendJson($array);