Delphi IdHTTP访问路由里的Web


本文整理自网络,侵删。

 RStream := TStringStream.Create('');

self.IdHTTP1.Request.Host := '192.168.3.198';
self.IdHTTP1.Request.UserAgent := 'Mozilla/5.0 (Windows; U; Windows NT 6.1 zh-CN; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10';
self.IdHTTP1.Request.Accept := 'text/html,application/xhtml+xml, application/xml;q=0.9,*/*;q=0.8';
self.IdHTTP1.Request.AcceptLanguage := 'zh-cn,zh,q=0.5';
self.IdHTTP1.Request.AcceptEncoding := 'gzip,deflate';
self.IdHTTP1.Request.AcceptCharSet := 'GB2312,utf-8;q=0.7,*;q=0.7';
self.IdHTTP1.Request.Connection := 'keep-alive';
self.IdHTTP1.Request.BasicAuthentication := true;
self.IdHTTP1.Request.Username := 'admin';
self.IdHTTP1.Request.Password := 'voip';
self.IdHTTP1.Request.Referer := 'http://192.168.3.198/submenu.htm';

self.IdHTTP1.Get('http://192.168.3.198/main.htm', RStream);
self.Memo1.Text := RStream.DataString;

相关阅读 >>

Delphi 刷新桌面函数

Delphi parent属性的另类用法

Delphi xe4 for ios 谨慎处理字符串

Delphi-改进获取文件md5 hash方法

Delphi xe8 为image设置渐变效果

Delphi里面判断一个字符串在另一个字符串中出现的次数

使用indy解决base64回车换行问题

Delphi 泛型容器单元(generics.collections) tdictionary<t>

Delphi package 把函数单元做成bpl调用

Delphi webbrowser中获取input表单值

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...