这是我截获的数据:
POST /login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=true HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*
Referer: https://www.battlenet.com.cn/login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=truehttps://www.battlenet.com.cn/login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=true
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: www.battlenet.com.cn
Content-Length: 64
Connection: Keep-Alive
Cache-Control: [email protected]&password=haitaoma1980&persistLogin=on
我就是照着这个原样,在delphi7里写的,但什么反应也没有,返回都是空字符串,快愁死我了。。下面是代码:
procedure TForm1.Button4Click(Sender: TObject);
var
Param:TStringList;
RStream:TMemoryStream;
mystr:TStringList;
FLogStr:string;
begin
IdHTTP2.Request.CustomHeaders.Clear;
IdHTTP2.Request.Accept := 'image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*' ;
IdHTTP2.Request.Referer := 'https://www.battlenet.com.cn/login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=true';
IdHTTP2.Request.AcceptLanguage := 'zh-cn';
IdHTTP2.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)';
IdHTTP2.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP2.Request.AcceptEncoding := 'gzip, deflate';
IdHTTP2.Request.Host := 'www.battlenet.com.cn';
IdHTTP2.Request.ContentLength := 64;
IdHTTP2.Request.Connection := 'Keep-Alive';
IdHTTP2.Request.CacheControl := 'no-cache';
Param:=TStringList.Create;
RStream:=TMemoryStream.Create;
Param.Add('[email protected]');
Param.Add('password=haitaoma1980');
Param.Add('persistLogin=on');
IdHTTP2.HTTPOptions:= IdHTTP2.HTTPOptions + [hoKeepOrigProtocol];
IdHTTP2.HTTPOptions := IdHTTP2.HTTPOptions - [hoForceEncodeParams]; //去掉自动编码
IdHTTP2.HandleRedirects := True;//允许自动跳转 IdHTTP2.Post('https://www.battlenet.com.cn/login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=true', Param,RStream);
mystr := TStringList.Create;
mystr.LoadFromStream(RStream);
Memo1.Text := mystr.Text ;
RStream.Free;
end;返回值一直是空,界面还有IdCookieManager1,IdSSLIOHandlerSocket1两个空间都与IDHTTP2相关联了,
大家给想个办法吧,有空的话,帮小弟我测试一下,都一个星期了,还是搞不定,郁闷delphiIDHTTPPOSTHTTPS
POST /login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=true HTTP/1.1
Accept: image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*
Referer: https://www.battlenet.com.cn/login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=truehttps://www.battlenet.com.cn/login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=true
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: www.battlenet.com.cn
Content-Length: 64
Connection: Keep-Alive
Cache-Control: [email protected]&password=haitaoma1980&persistLogin=on
我就是照着这个原样,在delphi7里写的,但什么反应也没有,返回都是空字符串,快愁死我了。。下面是代码:
procedure TForm1.Button4Click(Sender: TObject);
var
Param:TStringList;
RStream:TMemoryStream;
mystr:TStringList;
FLogStr:string;
begin
IdHTTP2.Request.CustomHeaders.Clear;
IdHTTP2.Request.Accept := 'image/gif, image/jpeg, image/pjpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*' ;
IdHTTP2.Request.Referer := 'https://www.battlenet.com.cn/login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=true';
IdHTTP2.Request.AcceptLanguage := 'zh-cn';
IdHTTP2.Request.UserAgent := 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)';
IdHTTP2.Request.ContentType := 'application/x-www-form-urlencoded';
IdHTTP2.Request.AcceptEncoding := 'gzip, deflate';
IdHTTP2.Request.Host := 'www.battlenet.com.cn';
IdHTTP2.Request.ContentLength := 64;
IdHTTP2.Request.Connection := 'Keep-Alive';
IdHTTP2.Request.CacheControl := 'no-cache';
Param:=TStringList.Create;
RStream:=TMemoryStream.Create;
Param.Add('[email protected]');
Param.Add('password=haitaoma1980');
Param.Add('persistLogin=on');
IdHTTP2.HTTPOptions:= IdHTTP2.HTTPOptions + [hoKeepOrigProtocol];
IdHTTP2.HTTPOptions := IdHTTP2.HTTPOptions - [hoForceEncodeParams]; //去掉自动编码
IdHTTP2.HandleRedirects := True;//允许自动跳转 IdHTTP2.Post('https://www.battlenet.com.cn/login/zh/?ref=https://www.battlenet.com.cn/account/management/&app=bam&cr=true', Param,RStream);
mystr := TStringList.Create;
mystr.LoadFromStream(RStream);
Memo1.Text := mystr.Text ;
RStream.Free;
end;返回值一直是空,界面还有IdCookieManager1,IdSSLIOHandlerSocket1两个空间都与IDHTTP2相关联了,
大家给想个办法吧,有空的话,帮小弟我测试一下,都一个星期了,还是搞不定,郁闷delphiIDHTTPPOSTHTTPS
解决方案 »
- 请推荐一款比较好的 RICHVIEW 编辑控件,要求能嵌入图片的
- 请问这个属性怎样赋?RzPanel1.BorderOuter:=fsflat;这样错的
- 如何让Excel的列自动长度?或列内容自动换行且居中?急
- 小猫提问:安装制作问题(二)WISE版
- 结算利润的问题,帮忙帮忙呀!sql语句如何写?
- 在DELPHI中能将指定的数据库中指定表中的关键字读出来或者能判断那些字段是关键字段也行,并且还能判断各列是否为空,能实现吗?最好能有
- 请熟悉DELPHI和GIS的高手进来!
- Delphi中数据库中保存的内容如何输出到word中
- 关于字符串中空格问题
- Delphi10.2使用Datasnap将Access数据库改造成服务器,开发三层
- 说说DELPHI的TDataSource数据控件
- fastreport 怎么使数据自动扩展
Param.Text := '[email protected]&password=haitaoma1980&persistLogin=on';提示账号密码错误,但一旦用上面的代码,也就是账号密码正确的时候,服务器就不反悔任何的信息,真是什么情况啊,大家帮帮忙吧
IDHTTP2.ProtocolVersion := pv1_1;
0:IdHTTP2.Request.AcceptEncoding := 'identity'; 或是IdHTTP2.Request.AcceptEncoding := ''; 自解压模式。
1:我用的事delphi7 ,是delphi7本省的组件,或是类库(dll)问题(很无语,以后不用delphi7了,用XE)
__utma=160654882.1915462864.1364961628.1364961628.1365305164.2; __utmb=160654882.1.10.1365305164; __utmz=160654882.1364961628.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmc=160654882
网上查了查:是Google的免费网站统计系统产生的信息,
哎,又不知所措了,该如何下手呢?