【问题标题】:try to curl to apple [closed]尝试卷曲到苹果 [关闭]
【发布时间】:2013-04-08 00:48:05
【问题描述】:

我使用此代码通过苹果登录进行 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;
?>

但它对我没有任何建议

【问题讨论】:

  • “它没有用”到底是什么意思?是否有任何错误消息或意外结果?
  • 这也很可能违反了 ToS,所以如果发现,Apple 将不会感激。
  • 我看到了发生未知错误。

标签: php curl


【解决方案1】:

注意@Andrey 指出的服务条款。

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

curl_setopt($ch, CURLOPT_POST, 1); 

【讨论】:

  • 试过了还是不行 有什么办法可以看到隐藏文件
  • 在拨打curl_exec($ch); 之后尝试print_r(curl_getinfo($ch));,看看有没有什么特别的地方。使用此信息转储更新您的问题。 php.net/manual/en/function.curl-getinfo.php
猜你喜欢
  • 2023-03-10
  • 1970-01-01
  • 1970-01-01
  • 2011-04-07
  • 1970-01-01
  • 2012-02-29
  • 1970-01-01
  • 2015-06-25
  • 2020-02-06
相关资源
最近更新 更多