Created
August 23, 2014 05:58
-
-
Save webchick/e1900c641ffc6dac6cfc to your computer and use it in GitHub Desktop.
8-line Guzzle script to read D8 REST API
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_once __DIR__ . '/core/vendor/autoload.php'; | |
use GuzzleHttp\Client; | |
$client = new Client(); | |
$response = $client->get('http://example.com/node/1', array( | |
'headers' => array('Accept' => 'application/hal+json') | |
)); | |
print_r($response->json()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment