试着卷曲到苹果

时间:2013-04-08 00:48:05

标签: php curl

我使用此代码卷曲苹果登录

 <?php
$url = "https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/wa/directToSignIn?localang=en_US";
$post_data['theAccountName'] = "Email@email.com";
$post_data['theAccountPW'] = "mypassword";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
$response = curl_exec($ch);

echo $response;
?>

但它对我没有任何建议

1 个答案:

答案 0 :(得分:0)

请注意@Andrey指出的ToS。

但也许您必须将HTTP方法设置为POST?

curl_setopt($ch, CURLOPT_POST, 1);