* 개요 ResponseEntity#getHeaders().setContentType(...) 를 호출했는데 UnsupportedOperationException 발생 * 원인 getHeaders() 로 HttpHeaders 가져올때는 Collections.unmodifiableList() 를 씌워서 반환함. 헤더 설정은 생성당시에만 하고, 그 뒤에는 보기만 하라는거. * 해결 헤더는 생성시에 설정함. MultiValueMap headers = new LinkedMultiValueMap(); headers.add("Content-Type", "application/json; charset=UTF-8"); ResponseEntity response = new ResponseEntity(/*바디*/, hea..
String 반환 대신 ResponseEntity 사용 header 에는 "Content-Type", "application/json; charset=UTF-8" 추가 되어 있어야 함 https://otep.tistory.com/38 * 기타 StringHttpMessageConverter 선언하는 방법 있었으나 알 수 없는 에서 SAXParserException 발생하여 시도해보지 못함. https://stackoverflow.com/questions/19218122/cvc-complex-type-2-4-c-the-matching-wildcard-is-strict-but-no-declaration-can