Parse a JSON data:
{“manifest”:{ Version:“3.0”}}
If you look carefully, this string is not in the normal JSON format. Version lacks double quotation marks. It should be:
{“manifest”:{ “Version”: “3.0”}}
Reprinted: https://www.cnblogs.com/afluy/p/4023838.html
If used
JSONObject mainfestObject.getJSONObject (“manifest”);
This method analysis will report an error, but if you use
String mainfestStr = object.optString (“manifest”, “”);
JSONObject mainfestObject = new JSONObject(mainfestStr);
The above method is successful!
Read More:
- The solution of “double quotation marks become escape characters” in Java parsing JSON
- Invalid operands to binary expression (‘double’ and ‘double’)
- Parsing the exception of storing JSON string in cookie
- How to query the production environment logstash report error parsing JSON
- [development experience] solution to unexpected syntax error: unexpected identifier in JSON parsing
- Gson Parsing exceptions: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 1 path $
- 【ipfs-api】npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
- npm ERR! registry error parsing json error report solution
- JSON data format net.sf.json .JSONException: A JSONObject text must begin with ‘{‘ at character 1 of Error:(f…
- [jQuery] jQuery operates on JSON strings or JSON objects
- Error reading JSON file: json.decoder.JSONDecodeError : Extra data: line 6 column 2 (char 1329)
- Python json.dumps () json.dump The difference between ()
- Configuration file for vscode setting.json UI interface or JSON form
- Springboot project: error parsing HTTP request header note: further occurrences of HTTP request parsing
- When websocket transmits JSON text, the parse method reports an error
- Unable to read workspace file ‘D:\angular.json‘: Invalid JSON character: “ “ at
- User defined profile in vscode settings.json And default configuration defaultSettings.json
- After using fastlick, double-click the error reporting solution
- Unexpected token o in JSON at p
- Solve the problem of Nacos double click flash back