我想知道有没有人在通过casperJS发送POST请求时遇到以下错误的经验。
this.open('https://'+host+'/test.php?test=new1', {
method: 'post',
data: {
'host':hostID,
'func':'newjob',
'apikey': key,
'test':testing
}
})下面推理的错误400非常神秘,并且没有引用Squid文档中的错误。
1515876312.758 0 10.2.1.101无/400 4272连接错误:double-CR- NONE/- text/html 1515876312.775 0 10.2.1.101无/400 4270连接错误:double-CR- NONE/- text/html 1515876312.811 0 10.2.1.101无/400 4272连接错误:double-CR- NONE/- text/html 1515876312.814 0 10.2.1.101无/400 4270连接错误:double-CR- NONE/- text/html1515876312.852 0 10.2.1.101无/400 4272连接错误:double-CR- NONE/- text/html 1515876312.967 0 10.2.1.101无/400 4235连接错误:double-CR- NONE/- text/html 1515876314.258 0 10.2.1.101无/400 4296连接错误:double-CR- NONE/- text/html 1515876314.329 0 10.2.1.101 NONE/400 4296连接错误:double-CR- NONE/- text/html1515876314.368 0 10.2.1.101无/400 4296连接错误:double-CR- NONE/- text/html 1515876314.672 0 10.2.1.101 NONE/400 4351连接错误:double-CR- NONE/- text/html 1515876314.738 0 10.2.1.101 NONE/400 4351连接错误:double-CR- NONE/- text/html 1515876314.773 0 10.2.1.101 NONE/400 4281连接错误:double-CR- NONE/- text/html1515876314.777 0 10.2.1.101无/400 4351连接错误:double-CR- NONE/- text/html 1515876314.829 0 10.2.1.101无/400 4281连接错误:double-CR- NONE/- text/html
CasperJS发出的输出是:
[info] [phantom] Starting...
[info] [phantom] Running suite: 1 step
Using UA=Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1
[info] [phantom] Step anonymous 1/1: done in 52ms.
[info] [phantom] Step anonymous 2/3: done in 67ms.
[warning] [phantom] Loading resource failed with status=fail: https://10.2.1.199/test.php?test=new1我看过这个,所以问/答:he following HTTP request returns a 400 ERR_INVALID_REQ -
这看起来很相似,但如果它们在问题中联系在一起-有人知道如何让CasperJS/phantomJS不添加空格吗?
发布于 2018-02-12 08:29:56
该问题是以下几个方面的组合:
Casper/Phantom显然在请求上有两个回车,Squid 3.1不喜欢这样。
在squid.conf集合中:
relaxed_header_parser打开
这不会在centos 6.x上停止Squid 3.1.x中的问题,但如果您升级到squid 3.4,它会修复该问题。
https://stackoverflow.com/questions/48244402
复制相似问题