【踩坑】RestTemplate报错
前言
RestTemplate报错:org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class java.lang.Object] and content type [text/html;charset=UTF-8]
原因
- RestTemplate不支持
Content-Type: text/html;charset=UTF-8
类型的响应数据格式
解决问题
- 添加一个
Content-Type: text/plan
响应数据格式
1 | RestTemplate restTemplate = new RestTemplate(); |