feign 发送form mata数据类型 调用不通问题,JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r

调用方式

@FeignClient(name = "remoteUserManagerService", url = "${base.url}")
public interface RemoteUserManagerService
{
    /**
     * 验证token是否正确
     *
     * @return 结果
     */
    @GetMapping(value = "/usermanager/user/pageList")
    public MessageBean listUserListVOs(@RequestParam("pageNum") Integer pageNum,@RequestParam("pageSize")Integer pageSize,
            @RequestParam("name")String name,
            @RequestHeader MultiValueMap <String ,String> headers);

 

@RequestParam无法直接加实体类,需要加编码器,如果请求参数不是太多的话,直接按照上述方法请求,但会报 JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r 下面是解决方法

配置文件添加

feign: 
  compression:
   response:
    useGzipDecoder: true

 

posted @ 2022-09-07 09:50  小尼  阅读(1208)  评论(0编辑  收藏  举报