我从服务器获得以下的字符串
回复:
{"fid":"1272","uri":"http://someurl/services/file/1272"}
我需要将它转换为一个
JSONArray
。有什么帮助吗?顺便说一下,我尝试了这个方法,但它不起作用:
String response=getResponseFromServer();
JSONArray array = new JSONArray(response);
I get the error:
org.json.JSONException: Value {"fid":"1272","uri":"http://someurl/services/file/1272"} of type org.json.JSONObject cannot be converted to JSONArray