E
For the analysis that I have done the API service requires that there is a User-Agent defined (I believe that the problem comes from there), this approach does not involve \Httpful\Request and I even believe that it is not necessary:$opts = array(
'http'=>array(
'header'=> "User-Agent: Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.102011-10-16 20:23:10\r\n"
)
);
$context = stream_context_create($opts);
$response = file_get_contents('https://api.github.com/users/nategood', false, $context);
Where the content of the $response It will be:{ "login": "nategood", "id": 154115, "avatar_url": " https://avatars.githubusercontent.com/u/154115?v=3 ", "gravatar_id": "", "url": " https://api.github.com/users/nategood ", "html_url": " https://github.com/nategood ", "followers_url": " https://api.github.com/users/nategood/followers ", "following_url": " https://api.github.com/users/nategood/following {/other_user}", "gists_url": " https://api.github.com/users/nategood/gists {/gist_id}", "starred_url": " https://api.github.com/users/nategood/starred {/owner}{/repo}", "subscriptions_url": " https://api.github.com/users/nategood/subscriptions ", "organizations_url": " https://api.github.com/users/nategood/orgs ", "repos_url": " https://api.github.com/users/nategood/repos ", "events_url": " https://api.github.com/users/nategood/events {/privacy}", "received_events_url": " https://api.github.com/users/nategood/received_events ", "type": "User", "site_admin": false, "name": "Nate Good", "company": "ShowClix, Inc.", "blog": " http://nategood.com ", "location": "Pittsburgh, PA", "email": "code@nategood. com", "hireable": null, "bio": "CTO @Showclix, Founder of @Firstbytes ", "public_repos": 34, "public_gists": 7, "followers": 124, "following": 25, "created_at": "2009-11-16T23:42:29Z", "updated_at": "2017-01ZThen I believe you know what to do with this, e.g. json_decode($response, true); to transform into an array etc...You can also do with curl:$curl = curl_init();
curl_setopt($curl, CURLOPT_RETURNTRANSFER, True);
curl_setopt($curl, CURLOPT_URL, 'https://api.github.com/users/nategood');
curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:7.0.1) Gecko/20100101 Firefox/7.0.1');
$response = curl_exec($curl);
curl_close($curl);