Created
September 15, 2011 20:39
Revisions
-
daharon revised this gist
Sep 15, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,6 @@ $response = $request->getResponseBody(); } echo $response; ?> -
daharon revised this gist
Sep 15, 2011 . 1 changed file with 10 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,14 +5,20 @@ 'http://10.1.1.150:8888/watch', HTTP_METH_GET, array( 'timeout' => 60, 'onprogress' => function ($input) { echo print_r($input, true); } ) ); try { $res = $request->send(); $response = $res->getBody(); } catch (\HttpRequestException $e) { $response = $request->getResponseBody(); } return $response; ?> -
daharon created this gist
Sep 15, 2011 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ #!/usr/bin/php <?php $request = new \HttpRequest( 'http://10.1.1.150:8888/watch', HTTP_METH_GET, array( 'onprogress' => function ($input) { echo print_r($input, true); }, 'timeout' => 60 ) ); $response = $request->send(); return print_r($response->getBody(), true); ?> This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ $ ./http_stream_test.php Array ( [dltotal] => 0 [dlnow] => 0 [ultotal] => 0 [ulnow] => 0 ) Array ( [dltotal] => 0 [dlnow] => 16 [ultotal] => 0 [ulnow] => 0 ) Array ( [dltotal] => 0 [dlnow] => 21 [ultotal] => 0 [ulnow] => 0 ) ... Array ( [dltotal] => 0 [dlnow] => 76 [ultotal] => 0 [ulnow] => 0 ) Array ( [dltotal] => 0 [dlnow] => 725 [ultotal] => 0 [ulnow] => 0 ) ...