delphi使用IdHTTP模拟提交页面方法
来源:互联网 发布:网络传真机服务 编辑:程序博客网 时间:2024/06/03 19:37
Posted in delphi Write comment 1.拖入TIdHTTP控件,HandleRedirect设为True,否则可能会出现HTTP 307错误。
2.主要的设置在Request里。
2.1 userAgent应该改为Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; CIBA; MAXTHON 2.0)
2.2 如果Accept-Encoding设为了gzip, deflate,那么需要再解码,所以如果没有必要的话Accept-Encoding应该设为空。
2.3 Referer应该设为post之前那个页面.
3.若需要取得cookie。
3.1 拖入TidCookieManager控件,将IdHTTP的CookieManager指向它,设定AllowCookies为True
3.2 设置全局变量mycookie:string;
3.3 在TidCookieManager的OnNewCookie事件中
mycookie:=ACookie.ClientCookie;
3.4 然后在用TIdHTTP控件Get页面后即可获取cookie
idhtp1.Get(‘http://de.mofeel.net/’);
cookies:=’Cookie:’+mycookie;
idhtp1.Request.CustomHeaders.Text:=cookies;
4.设置HTTPOptions的hoForceEncodeParams为False,否则post的数据可能会以%20形式编码。
5.若要使用HTTP/1.1,可将HTTPOptions的hoKeepOrigProtocol设为True,然后将ProtocolVersion设为pv1_1
1.拖入TIdHTTP控件,HandleRedirect设为True,否则可能会出现HTTP 307错误。
2.主要的设置在Request里。
2.1 userAgent应该改为Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; CIBA; MAXTHON 2.0)
2.2 如果Accept-Encoding设为了gzip, deflate,那么需要再解码,所以如果没有必要的话Accept-Encoding应该设为空。
2.3 Referer应该设为post之前那个页面.
3.若需要取得cookie。
3.1 拖入TidCookieManager控件,将IdHTTP的CookieManager指向它,设定AllowCookies为True
3.2 设置全局变量mycookie:string;
3.3 在TidCookieManager的OnNewCookie事件中
mycookie:=ACookie.ClientCookie;
3.4 然后在用TIdHTTP控件Get页面后即可获取cookie
idhtp1.Get(‘http://de.mofeel.net/’);
cookies:=’Cookie:’+mycookie;
idhtp1.Request.CustomHeaders.Text:=cookies;
4.设置HTTPOptions的hoForceEncodeParams为False,否则post的数据可能会以%20形式编码。
5.若要使用HTTP/1.1,可将HTTPOptions的hoKeepOrigProtocol设为True,然后将ProtocolVersion设为pv1_1
- delphi使用IdHTTP模拟提交页面方法
- delphi使用IdHTTP模拟提交页面方法总结
- delphi使用IdHTTP模拟提交页面方法总结
- delphi idhttp使用
- [delphi]indy idhttp post方法
- [delphi]indy10 idhttp get方法
- [delphi]indy10 idhttp get方法
- [delphi]indy10 idhttp get方法
- Delphi Idhttp的post方法
- Delphi用IdHTTP提交自定义Cookie
- DELPHI使用IDHTTP操作WEB
- Idhttp Post 模拟提交验证码
- Delphi Idhttp的 Get 和 Post 方法
- Delphi Idhttp的get和post方法
- Delphi使用IdHttp 获取 HttpsURL内容
- DELPHI使用IDHTTP显示网络图片
- Idhttp.post 模拟向网页服务器提交信息
- delphi IdHTTP实现Get方法下载文件,断点续传
- 委托概述
- 【动态规划】【RQNOJ】书的复制
- 基于三星S3C2440的文字显示 【转载】
- C++文件流打开文件失败原因
- already defined in *.obj“符号已定义”问题原理及解决方案
- delphi使用IdHTTP模拟提交页面方法
- 无法删除文件或文件夹的解决办法
- RED算法测试tcl脚本
- apache配置压缩节省带宽增加网速
- text,ntext或image节点的页(1:835),槽4不存在的解决方法
- C++好博客
- 最近在学习yui3
- Web3.0 时代 (2010-2020) 真的么?
- linux系统的网络设置的方法和一些参数