Hmm...
Code:
$params = [
'filter' => [
[
'property' => 'name',
'value' => '%beach%',
'operator' => 1
],
[
'property' => 'active',
'value' => 1
]
]
];
Ich sehe hier keine JSON Objecte, sondern ein array von Arrays...
Somit wohl eher:
Delphi-Quellcode:
procedure TDMod.DLOrdersActionExecute(Sender: TObject);
var JObj : tJSONArray;
JAry : tJSONArray;
Param : TRESTRequestParameter;
begin
RestRequest.Resource := 'orders';
JAry := tJSONArray.Create;
JObj := tJSONArray.Create; // Hier ein Daten ARRAY statt OBJECT
JObj.AddPair('property','customerId');
JObj.AddPair('expression','=');
JObj.AddPair('value',tJSONNumber.Create(3));
JAry.Add(JObj);
RestRequest.Params.Clear;
Param := RestRequest.Params.AddItem;
Param.Name := 'filter';
Param.Kind := TRESTRequestParameterKind.pkGETorPOST;
Param.Options := Param.Options + [TRESTRequestParameterOption.poPHPArray];
Param.Value := JAry.ToJSON;
RestRequest.Execute;
if RestResponse.StatusCode=200
then begin
ShowMessage(IntToStr(OrdersMemTable.RecordCount));
end;
end;