Home  >  Article  >  Backend Development  >  http - php curl chrome error: 405 method not allowed

http - php curl chrome error: 405 method not allowed

WBOY
WBOYOriginal
2016-06-06 20:16:071354browse

采集谷歌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错误就是谓词错误。

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn