Parsing Json data: How to get the name of the files inside a URL

I’m trying to create a plugin that downloads meshes by URL into UE4 in runtime, but don’t know how to get the name of the files. For example I have a link that has many URLs attached to it [Array ]and each URL is a different mesh with a different name, now what I’m trying to achieve here is that I want to get the name of each file when downloading these files. For example:

URL:
[
0: https://wall.fbx
1: https://door.fbx
2: https://window.fbx
]

So after downloading there should be files (wall.fbx, door.fbx, window.fbx) in my project folder.

This depends a little on if you need any additional information in the JSON or not, but the core idea remains the same. Let’s say you only need the file names then you could have a simple array:

{
Files: [
"file1.fbx",
"file2.fbx",
"file3.fbx"
]
}

This will allow you to acess the array by getting the value of the ‘Files’ key. Example:

const TArray<TSharedPtr<FJsonValue>>& itemArr = loadedData->GetArrayField(TEXT("Files"));
for (const TSharedPtr<FJsonValue>& item : itemArr)
{
	if (item.IsValid())
	{
		//load in the data
		DoSomethingWithTheName(item->AsString());
	}
}

If your data was more complex (i.e. each file name is contained within a JSON object which also includes additional information, then you might need to loop through JSON objects rather than accessing an array directly:

TSharedPtr<FJsonObject> registeredSequences = loadedData->GetObjectField(SaveObject_Sequences);
if (registeredSequences.IsValid())
{
	for (const auto& item : registeredSequences.Get()->Values)
    {
   		 //...do something with item
    }

}

This example really depends on how your data is structured though.