Feign接收文件流错误no suitable HttpMessageConverter found解决办法

洼地云 tuoyidashi.png

错误信息

通过Feign调用微服务其他组件接口,报错如下:

 no suitable HttpMessageConverter found for response type [class com.common.web.model.Page] and content type [image/jpeg;charset=utf-8]

或者

no suitable HttpMessageConverter found for response type [class com.common.web.model.Page] and content type [text/plain;charset=utf-8]

此接口的作用是以文件流形式返回结果,以供文件下载、预览等。

解决方式

应该以Response的方式接收文件流。 参考: Spring Cloud Feign如何获得接口返回的文件流

赞(1)
未经允许禁止转载:优米格 » Feign接收文件流错误no suitable HttpMessageConverter found解决办法

合作&反馈&投稿

商务合作、问题反馈、投稿,欢迎联系

广告合作侵权联系

登录

找回密码

注册