Skip to content

Commit

Permalink
[FIX] #167 - request with header
Browse files Browse the repository at this point in the history
  • Loading branch information
woowang789 committed Sep 15, 2022
1 parent f8e50d2 commit 78a3e33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/com/matdongsan/service/PlaceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ private void pullInfo(Place place) {
String facilityInfo="";
String mainPhotoUrl = "";
String url = "https://place.map.kakao.com/main/v/" + place.getId();
HttpEntity<Map<String, String>> httpEntity = new HttpEntity<>(new HttpHeaders());
HttpHeaders headers = new HttpHeaders();
headers.add("user-agent",
"Mozilla/5.0 (Windows NT 10.0; Win64; x64)" +
" AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36");
HttpEntity<Map<String, String>> httpEntity = new HttpEntity<>(headers);
ResponseEntity<String> response = restTemplate.exchange(url, HttpMethod.GET, httpEntity, String.class);
String body = response.getBody();

Expand Down

0 comments on commit 78a3e33

Please sign in to comment.