Spring boot GET 으로 호출시 response 값에 들어있는 한글이 깨지는 현상이 발생했었다.
아래와 같이 response 로 받은 값을 UTF-8로 인코딩을 해서 사용하니 문제가 해결되었다.
참고) httpGetConnection 은 내가 만든 메소드 이름이다.
HttpResponse response = httpGetConnection("http://{URL}");
HttpEntity entity= response.getEntity();
String result = EntityUtils.toString(entity, "UTF-8");
반응형
'Computer Science > Spring' 카테고리의 다른 글
[Spring] Optional 객체 여부에 따른 map 사용법 (1) | 2022.12.26 |
---|---|
[Spring] LZ4 압축 및 압축 해제 (FILE) (0) | 2022.08.22 |
[Spring] AOP 패러다임 (0) | 2019.01.01 |
[Spring] Mysql / MyBatis insert 쿼리 수행하면서 PK 가져오기 (0) | 2018.12.27 |
[Spring] Spring project log4j 충돌 현상 (0) | 2018.12.20 |