I encoded parameter of a url in UTF-8, and ran restTemplate. But I got error. I checked spelling of url again, but nothing was wrong. I found out restTemplate encoded url into Unicode.
The following is not working.
final String url = ApiUrls.areaBasedListApi + parameter;
// Initiate the request and return the results.
return restTemplate.getForObject(url, AreaBasedListData.class);
The following is working.
final String url = ApiUrls.areaBasedListApi + parameter;
// Initiate the request and return the results.
URI uri = new URI(url);
return restTemplate.getForObject(uri, AreaBasedListData.class);
댓글 없음:
댓글 쓰기