>  기사  >  백엔드 개발  >  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으로 문의하세요.