I am getting json data from an api. The api is working well when passing it through browser or postman, but there is a null response. As json is quite complicated I stringify it. My code is below:
String uri="api url";
RestTemplate restTemplate1 = new RestTemplate();
String result = restTemplate1.getForObject(uri, String.class);
System.out.println(result);//result is null
String jsonFormattedString = result.replaceAll("\\\\", "");//this throws null pointer exception