解决方法:
设置httpheader的时候,加上utf-8编码
String body = "中文你好"; RestTemplate restTemplate = new RestTemplate(); HttpHeaders headers = new HttpHeaders(); MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8"); headers.setContentType(type); HttpEntity<String> formEntity = new HttpEntity<String>(body, headers);