-1
虽然在我的Android应用程序从服务器解析JSON数据,我得到以下错误:错误在我的Android应用程序解析JSON
org.json.json exception value <html><head><title>Apache of type java.lang.String cannot conveted to JSONObject
有谁知道是什么引起的问题?
虽然在我的Android应用程序从服务器解析JSON数据,我得到以下错误:错误在我的Android应用程序解析JSON
org.json.json exception value <html><head><title>Apache of type java.lang.String cannot conveted to JSONObject
有谁知道是什么引起的问题?
您得到的错误是JSONException
。据json.org的JSON in Java(因为的Javadoc不是有用):
A JSONException is thrown when a syntax or procedural error is detected.
你试图解析的数据是JSON format的不是。它看起来像是HTML。这可能是因为你查询了一个无效的url,它将返回一个错误页面,而不是你期望的JSON。
的JSON对象应该是这样的:
{
"foobar": "some value here",
"bla": "maybe another thing here",
"sub-document": {
"whatever": "lorem ipsum"
}
}
检查你正在回响应。 “