Created
July 15, 2014 14:51
-
-
Save sasezaki/415e758629a15b7e7994 to your computer and use it in GitHub Desktop.
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": { | |
"guzzlehttp/guzzle": "4.1.*@dev", | |
"guzzlehttp/streams": "dev-master" | |
} | |
} |
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 | |
use GuzzleHttp\Adapter\StreamAdapter; | |
use GuzzleHttp\Message\MessageFactory; | |
require_once __DIR__.'/vendor/autoload.php'; | |
$config = [ | |
'adapter' => new StreamAdapter(new MessageFactory) | |
]; | |
$client = new GuzzleHttp\Client(); | |
$r = $client->get('http://example.com'); | |
$stream = $r->getBody()->detach(); | |
fseek($stream, 0, SEEK_SET); | |
stream_copy_to_stream($stream, STDOUT); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment