I'm making a webservice callout to an external webservice and displaying data on a Lightning component. Data is returned in JSON format in multiple pages. Each page has 50 records. In my apex controller class, I make multiple callouts in a for loop by specifying page number and populate the data into a list which is then displayed on the lightning page. Everything was working fine as long as the maximum nuber of pages was 100.
But in some cases, data returned from JSON has more than 100 pages. Then I get this
Error System.LimitException: Too many callouts: 101.
I saw solutions where using Batch class was suggested but in my case, I have to display all the data on a UI page. I'm not making any updates. It is just displayed on a UI page. I'm not sure how to use batch class to make more than 100 callouts and display that data on a UI page. Can someone please suggest a solution or point me in a direction on how to handle this situation.