delphi XE8 NetHTTPRequest NetHTTPClient
2016-03-20 09:09
1866 查看
delphi xe8 推出2个新http控件,NetHTTPRequest、NetHTTPClient
可以调用ASP.Net 一般应用程序获取网页数据,用旧的控件idhttp控件也可以,推荐用新的这2个组件。
http://localhost:52384/Handler1.ashx
http://docwiki.embarcadero.com/RADStudio/XE8/en/What's_New_in_Delphi_and_C%2B%2BBuilder_XE8
Using an HTTP Client explains how to use the two new HTTP components, TNetHTTPClient and TNetHTTPRequest, to handle HTTP requests. See also the main HTTP client classes:
THTTPClient, that represents an HTTP client.
THTTPRequest, that represents a request from your client to a server.
THTTPResponse, that represents the server response to a request from your client.
可以调用ASP.Net 一般应用程序获取网页数据,用旧的控件idhttp控件也可以,推荐用新的这2个组件。
http://localhost:52384/Handler1.ashx
procedure TForm5.Button1Click(Sender: TObject); var ss: TStringStream; begin ss := TStringStream.Create('', TEncoding.ASCII);//中文用UTF8
ss.Clear; self.NetHTTPClient1.Get(url, ss); self.Caption := ss.DataString; ss.Free; end;
procedure TForm5.Button2Click(Sender: TObject); var ss: TStringStream; begin ss := TStringStream.Create('', TEncoding.ASCII); ss.Clear; self.NetHTTPRequest1.Get(url); self.Caption := ss.DataString; ss.Free; end;
http://docwiki.embarcadero.com/RADStudio/XE8/en/What's_New_in_Delphi_and_C%2B%2BBuilder_XE8
New HTTP Client API
The RTL provides several new network units with members that let you create an HTTP client, send requests to HTTP servers and handle their responses.Using an HTTP Client explains how to use the two new HTTP components, TNetHTTPClient and TNetHTTPRequest, to handle HTTP requests. See also the main HTTP client classes:
THTTPClient, that represents an HTTP client.
THTTPRequest, that represents a request from your client to a server.
THTTPResponse, that represents the server response to a request from your client.
相关文章推荐
- 不要在linux上启用net.ipv4.tcp_tw_recycle参数
- GO语言网络编程之TCP (v2)
- GO语言网络编程之TCP (v1)
- 多线程与网络
- 重新理解ssh登陆与https
- 高性能web站点的优化(二)-- 数据的网络传输
- 图解协议之图集
- 基于HttpClient的HttpUtils(后台访问URL)
- java TCP编程简单实现一个消息群发功能
- 使用HTTPS保障BOS数据安全性
- 百度https化、取消referer关键词显示有何影响?
- HTTP协议header标头详解
- CF 653D(Delivery Bears-网络流)
- https处理的一个过程,对称加密和非对称加密
- http://www.cnblogs.com/zz0412/tag/jenkins/
- 虚拟机下Linux(CentOS6.7)的网络配置
- Linux Socket 网络编程
- 欢迎大家收听喜马拉雅,我的主播频道http://m.ximalaya.com/weizhubo/44966139
- TCP协议详解---学习笔记
- 一个网络图片下载loader的实现