Could not extract response: no suitable HttpMessageConverter found for response type

異常信息如下

_Could not extract response: no suitable HttpMessageConverter found for response type [java.util.List<java.util.Ma
p<java.lang.String, java.lang.Object>>] and content type [application/xml;charset=UTF-8]
feign.codec.DecodeException: Could not extract response: no suitable HttpMessageConverter found for response type [java.util.List<java.util.Map<java.lang.String, java.lang.Object>>] and content typ
e [application/xml;charset=UTF-8]

原因

  • 服務提供者返回值爲xml
  • 調用服務者沒有對應的HttpMessageConverter

解決方案

// feign api 中設置 produces = "application/json;charset=utf-8"
 @GetMapping(value = "/path", produces = "application/json;charset=utf-8")
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章