背景:
A服务发送请求到B服务,B服务返回响应数据至A服务,数据格式为json
,A服务获取响应数据解析时报错:
org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type [class com.alibaba.fastjson.JSONObject] and content type [text/html;charset=ISO-8859-1]
A服务中的配置如下
<!--JSON映射 转换器 -->
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<!-- 配置fastjson中实现HttpMessageConverter接口的转换器 -->
<bean cla