苏飞论坛

标题: 问题在哪 [打印本页]

作者: 追梦    时间: 2016-10-20 22:32
标题: 问题在哪
用fiddler截取的cookie
POST https://visaservicesonline.vfsgl ... egistrationPwd.aspx HTTP/1.1
Host: visaservicesonline.vfsglobal.com
Connection: keep-alive
Content-Length: 2275
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Origin: https://visaservicesonline.vfsglobal.com
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36
Content-Type: application/x-www-form-urlencoded
Referer: https://visaservicesonline.vfsgl ... ilRegistration.aspx
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.8
Cookie: ASP.NET_SessionId=435b09fc-a6ae-4a97-a698-64f6e58ec6fe

我自己写的cookie中包含了:
request.AllowAutoRedirect = true;
            request.KeepAlive = true;
            request.Method = "POST";
            request.ProtocolVersion = new Version("1.0");
            request.Proxy = WebRequest.DefaultWebProxy;
            request.Credentials = CredentialCache.DefaultCredentials;
            request.Headers.Add("Cache-Control: max-age=0");
            request.Headers.Add("Upgrade-Insecure-Requests", "1");
            request.Headers.Add("Accept-Encoding", "gzip,deflate,sdch,GB2312");
            request.Headers.Add("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4,zh-TW;q=0.2,fr;q=0.2,ja;q=0.2");
            request.ContentType = "application/x-www-form-urlencoded";
            request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
其中怕post也是一样的但是就是不能到下一个界面,我对比发现我的例程里面少了Referer: https://visaservicesonline.vfsgl ... ilRegistration.aspx这个有很大影响吗
            request.UserAgent = " Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36";


作者: 客服~小小    时间: 2016-10-21 11:23
我有点疑惑你的问题是什么,这个Referer不好说,服务端限制就影响,不限制就没有影响
作者: 东明    时间: 2016-10-21 14:31
你都分不清什么是Cookie
作者: 追梦    时间: 2016-10-22 08:11
客服~小小 发表于 2016-10-21 11:23
我有点疑惑你的问题是什么,这个Referer不好说,服务端限制就影响,不限制就没有影响

程序再之前运行中都没问题唯独到这一步时候一直post不过去:
作者: 客服~小小    时间: 2016-10-24 10:04
追梦 发表于 2016-10-22 08:11
程序再之前运行中都没问题唯独到这一步时候一直post不过去:

那就是验证没通过。所以Post不过去,应该是参数和Cookie原因,你再核对一下




欢迎光临 苏飞论坛 (http://www.sufeinet.com/) Powered by Discuz! X3.4