本文整理自网络,侵删。
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 使用google translate实现tts
更多相关阅读请进入《Delphi》频道 >>