procedure TForm1.FCCStart;
var
ware,
data,
Answer : String;
DataToSend : TStringList;
lHTTP: TIdHTTP;
begin
lblStatus.Caption:='Request gestartet...';
lHTTP := TIdHTTP.Create;
try
try
lHTTP.HandleRedirects := True;
lHTTP.ReadTimeout := 5000;
ware := 'Testware';
data := '{"clientId": "TestEAS002","processType": "Bestellung-V1","processData": "1^'+ware+'^999 Euro","externalTransactionId": "'+extaid+'"}';
DataToSend := TStringList.create;
DataToSend.Add(data);
try
lHTTP.Request.Accept := 'application/json';
lHTTP.Request.ContentType := 'application/json';
lHTTP.Request.CustomHeaders.FoldLines := False;
lHTTP.Request.CustomHeaders.Add('Authorization:Bearer '+accesstoken);
Answer := lHTTP.Post('http://
localhost:20001/transaction', DataToSend);
finally
DataToSend.Destroy;
end;
Memo1.Lines.Clear;
Memo1.Lines[0]:=Answer;
except
on E:
Exception do
lblStatus.Caption:=E.ToString;
end;
finally
lHTTP.Destroy;
end;
end;