1.Exception in thread "main" com.alibaba.fastjson.JSONException: syntax error, expect {, actual ]
就是说实际上想要的是{},而不是[]
错误案例: String request = "[\"data\"=\"today\", \"type\"=\"JSON\"]"
(只要是这种都是格式不正确,还有比如syntax error, expect :, actual =等等)
错误案例: String request = "{\"data\"=\"today\", \"type\"=\"JSON\"}"
2.com.alibaba.fastjson.JSONException: syntax error,
错误案例: String request = "{data:today, type:JSON}";
正确案例:String request = "{\"data\":\"today\", \"type\":\"JSON\"}";
JSONObject obj = JSON.parseObject(request);