json – Delphi Web Service Parameters


I have a service running in Delphi with DataSnap REST, it serves to read data and returns the query to whoever requested it, but now the client needs to consume this data via the web passing some parameters, so good, I made the function it returns the data in a JSON array, my question would be how to handle the parameters it passes, such as


passing a reference= parameter in DataSnap REST would be like this


there is no need to specify what you are going to search, with an equals sign just pass the parameters, does anyone have any ideas?


I managed to solve the problem using the GetInvocationMetaData function, where it returns the parameters used in the link to the WebService . I'll put an example of how to use this function:

declare in usues Data.DBXPlatform

  oMetaData: TDSInvocationMetadata  
  i: Integer;  
  s: String;  
  oMetaData: GetInvocationMetadata;

  for i := 0 to oMetaData.QueryParams.Count-1 do
    s := oMetaData.QueryParams[i];
Scroll to Top