首頁  >  文章  >  後端開發  >  http - php curl chrome error: 405 method not allowed

http - php curl chrome error: 405 method not allowed

WBOY
WBOY原創
2016-06-06 20:16:071309瀏覽

采集谷歌chrome商店的时候,提示这错误:
405 method not allowed

怎么解决呢?

code:

<code>

<?php $url = ("https://chrome.google.com/webstore/ajax/item?hl=zh-CN&gl=US&pv=20141016&mce=rlb,svp,atf,c3d,ncr,ctm,ac,hot,euf,fcf,aph,pot,rma,shr&count=96&token=225@31835950&category=ext/22-accessibility&sortBy=0&container=CHROME&_reqid=3821481&rt=j");
 $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, "https://chrome.google.com/");
$rep = curl_exec($ch);
$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE);

curl_close($ch);
// print_r($result);
echo "$httpCode"."code";
print_r($req);
?>



这条连接直接访问不了,但是你访问谷歌chrome商店网页往下加载有api,就是这条。
</code>

回复内容:

采集谷歌chrome商店的时候,提示这错误:
405 method not allowed

怎么解决呢?

code:

<code>

<?php $url = ("https://chrome.google.com/webstore/ajax/item?hl=zh-CN&gl=US&pv=20141016&mce=rlb,svp,atf,c3d,ncr,ctm,ac,hot,euf,fcf,aph,pot,rma,shr&count=96&token=225@31835950&category=ext/22-accessibility&sortBy=0&container=CHROME&_reqid=3821481&rt=j");
 $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, "https://chrome.google.com/");
$rep = curl_exec($ch);
$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE);

curl_close($ch);
// print_r($result);
echo "$httpCode"."code";
print_r($req);
?>



这条连接直接访问不了,但是你访问谷歌chrome商店网页往下加载有api,就是这条。
</code>

405错误就是谓词错误。

我测试了你链接,已经无法访问,请确定链接正确性。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn