unit uDelete_PS_HTTPClient;
{< gathers ID from external and Sends it to Server

IDList sent as JSON format

}

interface

uses
  System.SysUtils, System.Classes, System.JSON;

type
  TDelete = class(TDataModule)
  private
    { Private declarations }

    FIDListToDelete:TStringList;

  public
    { Public declarations }


    procedure Delete(IDList:TStringList);
    {< will convert it to JSON and will send to JSON}

    property IDListToDelete:TStringList read FIDListToDelete
    write FIDListToDelete;

  end;

//var
//  Delete: TDelete;

implementation

{%CLASSGROUP 'Vcl.Controls.TControl'}

{$R *.dfm}

{ TDelete }

procedure TDelete.Delete(IDList: TStringList);

var JSONObject:TJSONObject;
    i: Integer;
    JsonStringWithIDValues: String;

begin


JSONObject:=TJSONObject.Create;
try

// --- converting to JSON

for i := 0 to IDList.Count-1 do
JSONObject.AddPair( (TJSONPair.Create(i.ToString,IDList[i] )) );

JsonStringWithIDValues:=JSONObject.ToString();


finally


FreeAndNil(JSONObject);

end;




end;

end.
