delphi IdHTTP访问路由里的Web  
官方Delphi 学习QQ群: 682628230(三千人)
频道

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;
推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.040239095687866 seconds