Home  >  Article  >  Backend Development  >  施用curl获取地址的时候,显示Bad Request.但是这个地址在浏览器里有可以打开

施用curl获取地址的时候,显示Bad Request.但是这个地址在浏览器里有可以打开

WBOY
WBOYOriginal
2016-06-13 10:37:09964browse

使用curl获取地址的时候,显示Bad Request.但是这个地址在浏览器里有可以打开
使用curl获取地址的时候,显示Bad Request.但是这个地址在浏览器里有可以打开,程序也没有问题。采集别的网址是可以的

------解决方案--------------------
几种情况
1.远端有检测客户端过滤行为
2.远端有redir行为
3.请求中间层
4.近端有过滤行为
5.某个过程有缓存机制
6.未知

几种情况大致都是你并非直达“真实内容”

无终极解决方案,有的话,可以拿出来取笑一下某校长


------解决方案--------------------
我遇到过这种情况,就是没有获取到真是的地址!
可以试试firefox的插件httpfox,看看能否获取到真实地址,如果不行
你可以下载一个获取真实地址的软件试试。

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