Unexpected character (‘<‘ (code 60)): expected a valid value (JSON String, Number, Array, Object or

Error while extracting response for type [class XXXXX] and content type [text/html;charset=UTF-8]; nested exception is org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Unexpected character (‘\u003c’ (code 60)): expected a valid value (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’); nested exception is com.fasterxml.jackson.core.JsonParseException: Unexpected character (‘\u003c’ (code 60)): expected a valid value (JSON String, Number, Array, Object or token ‘null’, ‘true’ or ‘false’)
正常情况下,接口调用应当返回正确数据的json格式,并且返回的数据中确定不包含小于符号 < ,但是偏偏就出现了解析数据中有小于符号的情况,百思不得解。

正确的content type应当为:application/json

而上述错误中报content type 为:text/html

经过分析得知出现改问题的答案为:调用接口过程中被认证程序拦截了,也就是调用接口的时候Token过期或者url路径错误,于是返回了错误页面,错误页面是一个html页面,或者被强制跳转到了登录页面,html页面的content type 为:text/html ,html 页面的数据开头:
如果你遇到了解析json 个数数据时候出现这种莫名奇妙是错误,那很可能也是这种原因

  • 8
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值