formatexception(formatexception:意外字符(在字符1处)json [英] formatexception (formatexception: unexpected character (at character 1) json

查看:305
本文介绍了formatexception(formatexception:意外字符(在字符1处)json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所述错误为:formatexception(formatexception:意外字符(在字符1处)json有解决办法吗?

The error as stated is: formatexception (formatexception: unexpected character (at character 1) json Is there a solution to this?

推荐答案

您可以在Exception中看到,您在响应中获取HTML代码而不是JSON:

As you can see in the Exception, you are getting HTML code instead of JSON in the response.body:

<!DOCTYPE html PUBLIC "~//W3C/DTD XHTML 1.0 Strict//EN" "http://www.w3.org...

解决方案是接收JSON或尝试解析HTML

The solution would be to receive a JSON or to try to parse the HTML

这篇关于formatexception(formatexception:意外字符(在字符1处)json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆