PHP code example of shalvah / crs-request

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

    

shalvah / crs-request example snippets


// Configuration details
$config  = [
  'base_url' => 'http://api.hng.tech',
  'client_id' => '12345',
  'client_secret' => 'SUPER_SECRET_CLIENT_SECRET',
  'scopes' => ['locations.read', 'hotels.read'],
  'storage_path' => '/tmp' // optional
  ];
$request = new HNG\Http\Request($config);
$hotels = $request->get('/hotels');