is there a way to print the content from the api to the localhost server?

Your inner loop uses the wrong loop variable and moves j past the end of the array:

// Don't do this
for (int j = 0 ; i < object.length(); j++) { // Comparing "i"; compare "j" instead

// Do this
for (int j = 0 ; j < object.length(); j++) {

It’s not clear why there needs to be an outer loop, though; you’re pulling a known property from a known response; there’s no reason for the outer loop AFAICT.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top