解决方法:
设置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);本文出自 “www.bogo.com” 博客,请务必保留此出处http://483181.blog.51cto.com/473181/1959017
原文:http://483181.blog.51cto.com/473181/1959017