CURL给出了暂时移动的HTTP / 1.1 302

时间:2017-07-03 13:02:23

标签: php redirect curl cookies http-status-code-302

CURL提供暂时移动的HTTP / 1.1 302

$ua = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.A.B.C Safari/525.13';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://...........");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch1, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch1, CURLOPT_POST, true);
curl_setopt($ch1, CURLOPT_HTTPHEADER, array('Accept: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11'));
$result = curl_exec($ch1);

输出:

  

HTTP / 1.1 302暂时移动内容长度:0连接:保持活动日期:2017年7月3日星期一   格林尼治标准时间12:23:55   设置Cookie:AWSALB = ZBxF0OO7JHWtHtsbAUVLo1a2Y7GQ1KTxIaMml + 1UFTDK2UL7V6Xm8FIU1mWeCDZDtYvQ0emHLPLOtWpli   + 6pqFbYe + ulWPA8SBqeM / n5S9x0ScxYTGVsUeDixyuf;到期=周一,2017年7月10日12:23:55 GMT;路径= /服务器:nginx / 1.8.0位置:   https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx X-​​Cache:小姐   来自cloudfront Via:1.1   ea5d711fdce750991b725e09c07704b0.cloudfront.net(CloudFront)   X-Amz-Cf-Id:rVytkGKHVM628Zh3WFSohHlVdb-6XXZX-cXlQkvtRSeDCZN95s9Guw ==

0 个答案:

没有答案