Quelqu'un peut-il s'il vous plaît me signaler où je me trompe avec cela?Récupérer des données de contact google en utilisant AuthSub
<?php
if(!empty($_GET))
{
if(isset($_GET['token']))
{
$token = $_GET['token'];
$ch = curl_init('https://www.google.com/m8/feeds/');
if($ch)
{
curl_setopt
(
$ch,
CURLOPT_HTTPHEADER,
array
(
/* "Content-Type: application/x-www-form-urlencoded",*/
"Authorization: AuthSub token=\"{$token}\""
)
);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
//curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_HTTPGET,true);
curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
curl_setopt($ch,CURLOPT_HEADER,true);
//curl_setopt($ch,CURLOPT_POST,true);
$res = curl_exec($ch);
echo $res.'<br />';
}
}
}
>
Et voici le lien im en utilisant pour rediriger l'utilisateur vers google -
Il ne cesse de me donner cette -
HTTP/1.1 400 Bad Request
Content- Type: texte/html; charset = UTF-8 Date: dim, 28 nov. 2010 09:59:53 GMT Date d'expiration: Dim 28 Nov 2010 09:59:53 GMT Cache-Control: privé, max-age = 0 X-Content -Type-Options: nosniff X-Frame-Options: SAMEORIGIN Protection X-XSS: 1; mode = bloc serveur: EGE Transfer-Encoding: chunked
Requête invalide URI
Toute idée qui que ce soit? Je sais im mal dans un ou plusieurs endroits, mais mon cerveau ne fonctionne pas, comme im essayant avec cela pour près de 4 heures: D
Merci, Anjan