PHP code example of codeages / rest-api-client

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

    

codeages / rest-api-client example snippets


use Codeages\RestApiClient\RestApiClient;
use Codeages\RestApiClient\Specification\JsonHmacSpecification;

$config = array(
    'accessKey' => 'testkey',
    'secretKey' => 'secretKey',
    'endpoint' => 'http://domain.tld/api/v1/',
);

$spec = new JsonHmacSpecification('sha1');

$client = new RestApiClient($config, $spec);

$result = $client->get('/');