This repository was archived by the owner on Jul 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
This repository was archived by the owner on Jul 28, 2022. It is now read-only.
Error in "User-Agent header " #10
Copy link
Copy link
Open
Description
Hi there,
I'm trying to use the api, but with this basic code :
require_once dirname(__FILE__) . '/github-api3-php/lib/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php';
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
// Register the location of the GitHub namespace
$loader->registerNamespaces(array(
'Buzz' => __DIR__.'/github-api3-php/lib/vendor/Buzz/lib',
'GitHub' => __DIR__.'/github-api3-php/lib'
));
$loader->register();
use GitHub\API\Authentication;
use GitHub\API\User\User;
use GitHub\API\AuthenticationException;
use GitHub\API\User\User;
// Setup the user, and authenticate (using basic HTTP auth)
$user = new User();
$user->setCredentials(new Authentication\Basic('quoidautre', 'MY_PASSWORD'));
$user->login();
// Get the user details
$response = $user->get();
var_dump($response);
I've this error :
object(Buzz\Message\Response)[8]
protected 'headers' =>
array (size=4)
0 => string 'HTTP/1.0 403 Forbidden' (length=22)
1 => string 'Cache-Control: no-cache' (length=23)
2 => string 'Connection: close' (length=17)
3 => string 'Content-Type: text/html' (length=23)
protected 'content' => string 'Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required). Check https://developer.github.com for other possible causes.' (length=213)
Any idea ?, can anybody helps me ?
Thanks.
Fabrice
Metadata
Metadata
Assignees
Labels
No labels