本文整理自网络,侵删。
var
http: TIdHttp;
sendtoserver: TStringStream;
str: string;
begin
http := TIdHttp.Create(); // 创建
http.HandleRedirects := True; // 允许转头
http.ReadTimeout := 3000; // 延迟时间
http.Request.ContentType := 'application/json'; // 要求格式
sendtoserver := TStringStream.Create(joserv.AsJSON());
str := http.Post('http://192.168.1.149/epark/WinData.php', sendtoserver); // 服务器端
end;
相关阅读 >>
Delphi中转向语句break,continue,exit的作用
Delphi winapi: setwindowtext - 设置窗口标题
Delphi getcomputername() getusername() 获取本机当前用户名
更多相关阅读请进入《Delphi》频道 >>