PHP code example of chocofamilyme / smart-http

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

    

chocofamilyme / smart-http example snippets


    $request = new Chocofamily\SmartHttp\Http\Request($config, $cache);

    $options = [
        'serviceName' => 'serviceA',
        'cache'       => 3600,
        'data'        => [
            'id' => 1
        ],
    ];

    $response = $request->send('GET', 'http://service/item', $options);