0
我想調用休息API並從API獲取數據。我需要在spring引導中爲url添加動態參數。我有點失落,因爲我應該如何去做。任何人都可以向我建議一些東西嗎?將參數追加到Spring引導Java中的現有url?
RestTemplate restTemplate = new RestTemplate();
String consumeJSONString = restTemplate.getForObject("https://maps.googleapis.com/maps/api/geocode/json?latlng=5.47686,-73.961452&key=YOUR_API_KEY"
, String.class);
我想動態地在URL中追加latlng和api鍵。我真的很感激任何建議。