Skip to content

Instantly share code, notes, and snippets.

@mosampaio
Last active August 24, 2016 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mosampaio/6ed253abd572b6ac45828d7ea99cde36 to your computer and use it in GitHub Desktop.
Save mosampaio/6ed253abd572b6ac45828d7ea99cde36 to your computer and use it in GitHub Desktop.
How to consume a json Rest API with PHP using Unirest
<?php
require __DIR__ . '/vendor/autoload.php';
$response = Unirest\Request::get('https://api.github.com/repos/twilio/twilio-php/contributors');
print_r($response->body);
{
"require": {
"mashape/unirest-php": "3.*"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment