PHP code example of digitickets / generic-api-client

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

    

digitickets / generic-api-client example snippets




enericApiClient\ApiClient;

$apiClient = new ApiClient('https://some-api.com);

$response = $apiClient->get('dogs'); // Returns a PSR ResponseInterface.

// You can get an array of data from the response object with this method:
$dogs = $apiClient->parseResponse($response);

print_r($dogs);
// Returns:
// Array
// (
//     [0] => Array
//         (
//             [dogID] => 11
//             [name] => Merlin