PHP code example of demartis / rest-proxy

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

    

demartis / rest-proxy example snippets



Symfony\Component\HttpFoundation\Request;

use RestProxy\RestProxy;
use RestProxy\CurlWrapper;

$proxy = new RestProxy(
    Request::createFromGlobals(),
    new CurlWrapper()
    );
$proxy->register('github', 'https://api.github.com');
$proxy->run();


foreach($proxy->getHeaders() as $header) {
    header($header);
}
echo $proxy->getContent();

curl -s https://getcomposer.org/installer | php

php composer.phar 

php composer.phar 

cd proxy
php -S localhost:8888 -t www/