I have used the below piece of code for calling a third-party API from my spring boot application.
@GetMapping("/client-call")
public String getResponseFromClient(){
String result = null;
for (int i = 0; i < 100; i++) {
RestTemplate restTemplate = new RestTemplate();
String uri = "https://blockstream.info/testnet/api/address/tb1qswa0hq3px3arz229y98m67fprw7ujpvxkztgszvt090rkgnq2hysf85hlg/txs";
result = restTemplate.getForObject(uri, String.class);
System.out.println(i + "\t" + result);
System.out.println("---------------------------------------------");
}
return result;
}
when I deployed this spring boot jar file on a microsoft azure vm, it throws an error of too many requests: logs