JSON parse error: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t)

JSON parse error: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens; nested exception is com.fasterxml.jackson.core.JsonParseException: Illegal character ((CTRL-CHAR, code 31)): only regular white space (\r, \n, \t) is allowed between tokens
at [Source: (PushbackInputStream); line: 1, column: 2]

http调用的时候爆出这个错,其实就是参数过大,超过当前设置的最大参数长度,参数超过了,肯能部分被截掉了,导致json字符串不完整,也就解析出问题了。要么减小参数的长度,要么将参数的允许长度设置大一点。如下调整好min-request-size即可

# feign 配置
feign:
  compression:
    request:
      enabled: true
      min-request-size: 8192
    response:
      enabled: true

你可能感兴趣的:(java,java,json)