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 google text to speech api

Delphi 选择目录对话框(selectdirectory 函数)

Delphi 将jpg图片上传到sqlserver数据库里

Delphi html转义字符编码转换

Delphi 判断端口(port)是否被占用

Delphi xe6 for android 让手机震动

Delphi dbgrid查询内容的导出为txt函数

Delphi使焦点固定到一个button上

Delphi utf8乱码问题

Delphi 2009 之 tbuttonededit

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



打赏

取消

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

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

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

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

评论

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