No converter for [class xxx] Content-Type ‘appliction/octet-stream;charset=UTF-8‘ 的解决办法

报错的类:AbstractMessageConverterMethodProcessor

报错的代码块

No converter for [class xxx] Content-Type ‘appliction/octet-stream;charset=UTF-8‘ 的解决办法

 报错原因

respose在被传入其他的方法后,其content type 被篡改了,导致与request 的content type 不一致导致的

No converter for [class xxx] Content-Type ‘appliction/octet-stream;charset=UTF-8‘ 的解决办法

 解决方案一:将方法直接return null;No converter for [class xxx] Content-Type ‘appliction/octet-stream;charset=UTF-8‘ 的解决办法

  解决方案二:在return 之前,将request 与response的content type 设置为一样

No converter for [class xxx] Content-Type ‘appliction/octet-stream;charset=UTF-8‘ 的解决办法

上一篇:java.lang.NoSuchMethodError: org.apache.http.client.utils.URLEncodedUtils.parse(Ljava/net/URI;Ljava/


下一篇:java基础:NIO之异步FileChannel和Charset(5)