2017 © Pedro Peláez
 

library crs-request

Send HTTP requests to the Hotels.ng CRS API easily.

image

shalvah/crs-request

Send HTTP requests to the Hotels.ng CRS API easily.

  • Saturday, August 5, 2017
  • by shalvah
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

HNG Request

Make requests to the Hotels.ng CRS API easily., (*1)

How to use

Pull in the package from composer "shalvah/crs-request":"^2.0". That's all. A sample implementation is below., (*2)

// 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');

Debugging

Everytime an error occurs, the error details are logged in the log directory of your storage path (if set, otherwise the top-level directory). Here is an example of the logged information:, (*3)

[2016-12-05 03:16:52]
Endpoint: http://api.somesite.com/posts
Error:    cURL error 56: Problem (2) in the Chunked-Encoded data (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

The Versions

05/08 2017

dev-master

9999999-dev

Send HTTP requests to the Hotels.ng CRS API easily.

  Sources   Download

MIT

The Requires

 

by Neo Ighodaro

05/08 2017

2.0.0

2.0.0.0

Send HTTP requests to the Hotels.ng CRS API easily.

  Sources   Download

MIT

The Requires

 

by Neo Ighodaro