[FireMonkey]用IdHTTP发送Rest API

procedure TForm1.Button1Click(Sender: TObject);
var
  response : string;
  JSONToSend: TStringStream;
begin
  JSONToSend := TStringStream.Create('{}');
  IdHTTP1.Request.Connection := 'Keep-Alive';
  //IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method := sslvSSLv23;
  IdHTTP1.Request.CustomHeaders.Clear;
  IdHTTP1.Request.CustomHeaders.Values['Application-Id'] := 'yourAppId';
  IdHTTP1.Request.CustomHeaders.Values['REST-API-Key'] := 'yourRESTAPIKey';
  IdHTTP1.Request.ContentType := 'application/json';
  response := IdHttp1.Post('https://api.xxx.com/1/events/AppOpened', JSONToSend);
end;
原文地址:https://www.cnblogs.com/leamanXZ/p/5177460.html