Last active
August 24, 2016 17:26
-
-
Save mosampaio/f4b53e4bc8d46f8f27e53b5f91c28cfa to your computer and use it in GitHub Desktop.
How to consume a json Rest API with PHP using Httpful
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . '/vendor/autoload.php'; | |
$url = "https://api.github.com/repos/twilio/twilio-php/contributors"; | |
$response = \Httpful\Request::get($url)->expectsJson()->send(); | |
print_r($response->body); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"require": { | |
"nategood/httpful": "0.2.20" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment