开发者

Error: org.json.me.JSONException: A JSONObject text must begin with '{' at character 1 of [

开发者 https://www.devze.com 2023-03-31 05:25 出处:网络
how to solve error “org.json.me.JSONException: A JSONObject text mus开发者_如何学JAVAt begin with \'{\' at character 1 of [” in black berryWell, the error is showing that you are getting the values

how to solve error “org.json.me.JSONException: A JSONObject text mus开发者_如何学JAVAt begin with '{' at character 1 of [” in black berry


Well, the error is showing that you are getting the values in JSONArray and you are trying to get it in JSONObject, so change your JSONObject to JSONArray when you are getting the response.

You might be getting output in

[] = JSONArray not in

{} = JSONObject

Hope it works thanks.


Examples of valid JSON objects:

{} is used by Objects

{name: "Oh Chin Boon", age: "24"}

[] is used by Arrays

[ {name: "Oh Chin Boon", age: "24"}, {name: "Ken", age: "33"} ]
0

精彩评论

暂无评论...
验证码 换一张
取 消