0

誰かが私にこれのどこが間違っていたのか教えてもらえますか?

<?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 />';
        }
    }
}

?>

そして、これはユーザーをGoogleにリダイレクトするために使用するリンクです-

https://www.google.com/accounts/AuthSubRequest?scope=https://www.google.com/m8/feeds/&session=0&secure=0&next=http://www.etfaq.com/invite_friends.php% 3Ftype%3Dgmail

それは私にこれを与え続けます -

HTTP/1.1 400 Bad Request 

コンテンツ タイプ: テキスト/html; charset=UTF-8 Date: Sun, 28 Nov 2010 09:59:53 GMT Expires: Sun, 28 Nov 2010 09:59:53 GMT Cache-Control: private, max-age=0 X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block サーバー: GSE Transfer-Encoding: チャンク

無効なリクエスト URI

誰かアイデアはありますか?私は1つまたは複数の場所で間違っていることを知っていますが、これをほぼ4時間試しているため、私の脳は機能していません:D

ありがとう、アンジャン

4

1 に答える 1

0

すみません、私の間違いです :)

私は使用しなければならないことがわかりました

curl_init('https://www.google.com/m8/feeds/default/full');

それ以外の

curl_init('https://www.google.com/m8/feeds/');

ありがとう、アンジャン

于 2010-11-28T12:34:36.453 に答える