After making an HTTP request, I receive an array of objects in a JSON response. However, although I can index through the first array to select a specific object, I am unable to extract any values from the objects themselves.
The response I get from my request includes multiple objects within an array. My goal is to navigate through the entire array and access the names and values nested within each object at the second level.
{
"costByServiceList": [
{
"EC2 - Other": 0.0774193717,
"Amazon Elastic Compute Cloud - Compute": 0.5568
},
{
"EC2 - Other": 0.0774193867,
"Amazon Elastic Compute Cloud - Compute": 0.5568,
"AWS Cost Explorer": 0.02
},
{
"EC2 - Other": 0.077419386,
"Amazon Elastic Compute Cloud - Compute": 0.5568
},
{
"EC2 - Other": 0.0774193613,
"Amazon Elastic Compute Cloud - Compute": 0.5568
},
{
"EC2 - Other": 0.0774194716,
"Amazon Elastic Compute Cloud - Compute": 0.5568,
"AWS Cost Explorer": 0.76
},
{
"EC2 - Other": 0.0774620825,
"Amazon Elastic Compute Cloud - Compute": 0.5568,
"AWS Cost Explorer": 0.08
},
{
"EC2 - Other": 0.0763515633,
"Amazon Elastic Compute Cloud - Compute": 0.5568
}
]
}
I thought about converting the array into arrays, but it seems unnecessary for the desired outcome.