delphi 网上获取北京时间IdHTTPServer and IdHTTP 使用 Encoding UTF8


本文整理自网络,侵删。

 

IdHTTP1.Get('http://localhost/?msg=' + TIdURI.ParamsEncode('中国人'));

 

AResponseInfo.ContentType := 'text/plain';

AResponseInfo.CharSet := 'utf-8';

AResponseInfo.ContentText := '中国人';

Or:

 

AResponseInfo.ContentType := 'text/plain; charset=utf-8';

AResponseInfo.ContentText := '中国人';

 

procedure TForm1.OnCommandGet(AContext: TIdContext; ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);

var

  msg: string;

begin

  msg := ARequestInfo.Params.Values['msg'];

  TThread.Synchronize(nil,

    procedure

    begin

      Memo1.Lines.Add(msg);

    end

  );

  ...

end;

相关阅读 >>

Delphi在pagecontrol1上面的分页动态创建edit组件

Delphi得到字符串中第一个汉字的位置

Delphi 字符转16进制、16进制转字符

Delphi unigui确认对话框

Delphi 如何确定屏幕分辨率

Delphi webbrowser 操作记要

Delphi利用系统时间产生随机数的函数

Delphi 提高unigui开发效率的两个方法

Delphi pascal实现二分查找算法

Delphi 获取硬盘序列号(ide,sata,scsi)

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



打赏

取消

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

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

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

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

评论

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