【发布时间】:2014-03-11 14:53:57
【问题描述】:
我正在使用 android spring REST 模板从外部 API 中提取一些数据。 这些 API 返回 JSON 字符串,但响应内容类型为“text/html”,如果内容类型为“application/json”,我可以轻松解析数据而不会出现任何问题,因为此 API 是第 3 方 API,我无法更改内容类型的回应。
我正在使用 “映射杰克逊HttpMessageConverter” 类作为消息转换器。
当我尝试解析数据时遇到异常。
org.springframework.web.client.RestClientException: Could not extract response: no suitable HttpMessageConverter found for response type .... and content type [text/html;charset=utf-8]
有什么配置、参数之类的可以解析这些JSON数据吗?
【问题讨论】:
标签: android jackson spring-android