我試圖用cURL和PHP作爲用戶登錄到Dropbox。用curl登錄dropbox(用戶登錄)
$ch = curl_init();
$data = array(
't'=>'hxdlvCcN7SKKcfKCvpEO8-s2',
'lhs_type'=>'anywhere',
'login_email'=>'[email protected]',
'password'=>'mypass',
'login_submit'=>1,
'remember_me'=>'on',
'login_submit_dummy'=>'Sign in'
);
// set cURL options and execute
curl_setopt($ch, CURLOPT_URL, "https://www.dropbox.com/login?lhs_type=anywhere");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS,http_build_query($data));
$request_token_response = curl_exec($ch);
var_dump($request_token_response);
我得到403頁有這樣的文字:
It seems you tried to do something we can't verify. Did you log into a different Dropbox account in a different window? Try clicking here to go back to the page you came from, or just go home.
我在做什麼錯?
是否有你沒有使用[Dropbox的Api](https://www.dropbox.com/developers)的原因? – Wrikken 2013-03-09 15:35:01
上午使用api進行上傳,一切都正常,但他們沒有用於用戶登錄的API方法,他們正在將用戶發送到他們的網站進行登錄。 – 2013-03-09 15:56:08