Created
August 18, 2015 16:53
-
-
Save stuarthannig/d56f4bddf0b4c641a94c to your computer and use it in GitHub Desktop.
Using Guzzle 6 in Laravel 5.1
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 | |
# Install Guzzle by running `composer require guzzlehttp/guzzle` | |
Route::get('github/{username}', function ($username) { | |
$client = new GuzzleHttp\Client(); | |
$request = $client->get("https://api.github.com/users/{$username}"); | |
echo $request->getBody(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment