Tag Archives: JSON parsing error

209151; org.json.JSONException A JSONObject text must begin with'{‘at character 1 of {

Cause analysis:
parse the json data, the format is not correct, is usually as a result of the returned json data outside a layer of more “” (double quotes)
if, as a string, plus @ ResponseBody annotation, then parsing json over there will more outside a layer of” ”
Solutions:

(1) if the string is converted to json, then you need to call the json packet method (string turn json object), and then forwards the json object resolution in the past.
2. If the entity object, you need to call the Json packet method (object turn Json object), and then forwards the Json object resolution in the past.
no matter what you need to turn the object data type, anyhow can not directly return to the past for Json parsing, need to convert a Json object before parsing.
Last word: it’s not easy to write. If you like it or find it helpful, remember to follow it or bookmark it