I have a REST call that is working properly. I can pass parameters, it returns data.
The app uses TRESTClient
, TRESTResponse
, TRESTRequest
, TRESTAdapter
, feeding into TClientDataSet
and TDataSource
.
The end result is that when the JSON data comes in, I can iterate through it as if it was a table. With simple JSON, I can get this working.
I am now querying a REST service which is providing data that is one level deeper than normal. See JSON below.
Everything I need to access is UNDER the mycursor
element, which is under the items
element.
I can't change the REST service, so how can I tell one of these components to ignore the items
level and look at the mycursor
level?
The data I am looking to parse has a first element of id
.
{
"next":
{
"$ref":"https://<internal URL>/?page=1"
},
"items":
[
{
"mycursor":
[
{
"id":13372,
…
},
{
"id":13373,
…
},
{
"id":13374,
…
},
{
"id":13375,
…
},
{
"id":13376,
…
}
]
}
]
}