How do i pass values from an array, as parameters to a get request REST api call and save all responses received, for each item per api request.
I have the following file format:
Const Data = [
{
user: '123456'
},
{
user: '123456',
},
{
user: '123456',
},
}
]
the get url for the API is:
router.get(`/courses/:user)
What i'm trying to do:
pass all values of Data as parameter to the request, so it will look like this:
localhost:8000/courses/123456
This will happen for as many items in data, then gather together all the responses in on json output.
I have tried using forEach
but no luck so far.
Expected result should be a Json data with all responses:
var output = [{response1},{response2}, {responds3}]