error info: feign.codec.DecodeException: Could not extract response: no suitable HttpMessageConverte

使用feign框架的@FeignClient调用GET请求,并接受json返回值的时候,会报Could not extract response: no suitable HttpMessageConverte 异常

需要在fastMediaTypes添加fastMediaTypes.add(MediaType.TEXT_PLAIN);配置

 

List fastMediaTypes = new ArrayList();

fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
fastMediaTypes.add(MediaType.TEXT_PLAIN);

fastJsonHttpMessageConverter.setSupportedMediaTypes(fastMediaTypes);

 

你可能感兴趣的:(开发日常bug)