|
13楼

楼主 |
发表于 2018-10-9 19:10:27
|
只看该作者
四川省宜宾市

这两天天天在测试,最后发现返回的协议头带有"405",百度后说是访问格式错误,不能用post访问.还有的说是"静态页面"什么的,我把post包改成get,还是返回空白.实在是醉了.我把能取回信息的包和取不到信息的包发出来,麻烦你看看.(XX.XXX是网址)
能正确返回的:
POST http://XX.XX.X.XXX/team/command/commandList HTTP/1.1
Host: XX.XX.X.XXX
Connection: keep-alive
Content-Length: 142
Accept: application/json, text/plain, */*
Origin: http://XX.XX.X.XXX
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: http://XX.XX.X.XXX/index.html
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8
Cookie: JSESSIONID=047B9A8750C8A558BBBCB41FBBA020F4
querytype=1&relatetype=1&commandtype=&citycode=5000&countycode=50000&otherinfo=&pageNumber=1&pageSize=10&datetype=nolimit&startdate=&enddate=
不能正确返回,返回为空的:
POST http://XX.XX.X.XXX/team/command/commandList HTTP/1.1
Host: XX.XX.X.XXX
Connection: keep-alive
Content-Length: 142
Accept: application/json, text/plain, */*
Origin: http://XX.XX.X.XXX
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.155 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: http://XX.XX.X.XXX/index.html
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8
Cookie: JSESSIONID=047B9A8750C8A558BBBCB41FBBA020F4
querytype=1&relatetype=4&commandtype=&citycode=5000&countycode=50000&otherinfo=&pageNumber=1&pageSize=10&datetype=nolimit&startdate=&enddate=
就红色的数字那里,1是搜索待签收,4是待反馈,1能正确返回,4返回就是空白.
正确的返回是:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Cache-Control: no-store
Content-Type: application/json;charset=UTF-8
Date: Mon, 08 Oct 2018 08:46:28 GMT
Content-Length: 195
{"countTotal":true,"pageNumber":1,"pageSize":10,"totalPage":0,"totalRow":0,"beginIndex":1,"endIndex":10,"orderField":null,"orderMode":null,"criteria":{"alias":"this"},"headerList":null,"list":[]}
错误的返回是:
HTTP/1.1 405 Method Not Allowed
Server: Apache-Coyote/1.1
Cache-Control: no-store
Allow: GET, HEAD
Transfer-Encoding: chunked
Date: Mon, 08 Oct 2018 09:07:02 GMT |
|