Delphi EMS FireDAC: How do I access TEndpointRequest Params through their Index instead of the Name?

293 views Asked by At

I am working on Delphi EMS Resource Client FireDAC application.

For example, if I am passing 2 params from the client to the server. In server side, I can access the value of the params through their Names ('item1', 'item2'). But instead of accessing the params through their Name, I need to access it through Index.

Existing server implementation:

procedure TResource.GetItem(const AContext: TEndpointContext; 
 const ARequest: TEndpointRequest; const AResponse: TEndpointResponse);
var
  LItem1, LItem2: string;
begin
  LItem1 := ARequest.Params.Values['item1'];
  LItem2 := ARequest.Params.Values['item2'];
end;

Using Dataset I can access the Params using the List index like this (just as an example),

for I := 0 to Count-1 do
begin 
 FDQuery.Params[I].Value; 
end;

How can I do it with ARequest.Params?

I am waiting for some solutions.

Thanks in advance.

0

There are 0 answers