Answer the question
In order to leave comments, you need to log in
How to link together the data received on two pages?
Good day!
There is such a task:
I make a GET request to the page, it gives me the result in JSON, I rip out the id from there, and write them in one line:
if JSON.TryGetValue<TJSONArray>('response.items', JSONArr) then
begin
for I := 0 to JSONArr.GetValue<TJSONArray>.Count - 1 do
begin
if I > 0 then
user_id_list := user_id_list + ',' + JSONArr.GetValue<string>('[' + IntToStr(i) + '].message.user_id')
else
user_id_list := JSONArr.GetValue<string>('[' + IntToStr(i) + '].message.user_id');
end;
end;
{
"response": {
"count": 3,
"items": [
{
"message": {
"user_id": 1,
"body": "Текст body"
}
},
{
"message": {
"user_id": 2,
"body": "Текст body"
}
},
{
"message": {
"user_id": 3,
"body": "Текст body"
}
}
]
}
}
{
"response": [
{
"id": 1,
"first_name": "Текст1",
"last_name": "Текст1",
"photo_50": "http"
},
{
"id": 2,
"first_name": "Текст2",
"last_name": "Текст2",
"photo_50": "http"
},
{
"id": 3,
"first_name": "Текст3",
"last_name": "Текст3",
"photo_50": "http"
}
]
}
id:1, Text body, Text1 Text1, http
id:2, Text body, Text2 Text2, http
id:3, Text body, Text33 Text3, http
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question