procedure TForm1.Button2Click(Sender: TObject);
var
RESTClient: TRESTClient;
RESTRequest: TRESTRequest;
RESTResponse: TRESTResponse;
slCustomerIds: TStringlist;
begin
try
RESTClient := TRESTClient.Create(nil);
RESTClient.BaseURL := 'https://
api.blaulichtsms.net/blaulicht/
api/alarm/v1/scenario/config/list';
try
RESTResponse := TRESTResponse.Create(nil);
RESTRequest := TRESTRequest.Create(nil);
RESTRequest.Client := RESTClient;
RESTRequest.Response := RESTResponse;
RESTRequest.Method := rmPOST;
// RESTRequest.Resource := '
api/alarm/v1/scenario/config/list';
RESTRequest.AddParameter('Content-Type', 'application/json', pkHTTPHEADER, [poDoNotEncode]);
try
slCustomerIds := TStringlist.Create;
slCustomerIds.Add('{');
slCustomerIds.Add('"username" : "ag-
api-contechnet",');
slCustomerIds.Add('"password" : "xxxxx",');
slCustomerIds.Add('"customerIds" : ["xxxxx"]');
slCustomerIds.Add('}');
finally
RESTRequest.AddParameter('Body', slCustomerIds.Text, pkREQUESTBODY, [poDoNotEncode]);
slCustomerIds.Free;
end;
RESTRequest.Execute;
if RESTResponse.Status.Success then
ShowMessage(RESTResponse.Content);
finally
RESTResponse.Free;
RESTRequest.Free;
end;
finally
RESTClient.Free;
end;
end;