Last active
January 3, 2016 09:43
-
-
Save bzz0217/f20dc4000a51221849bf to your computer and use it in GitHub Desktop.
github api oauth認証してデータを取得する
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 | |
$options = array( | |
'http'=>array( | |
'method' => 'GET', | |
'header' => array( | |
'Authorization: token [API_TOKEN]', | |
'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36', | |
) | |
) | |
); | |
$context = stream_context_create( $options ); | |
$contents = file_get_contents( 'https://api.github.com/users/bzz0217', FALSE, $context ); | |
var_dump($contents); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment