Java Convert this string to JSONArray [closed]
I am getting the following String response from a server: {"fid":"1272","uri":"http://someurl/services/file/1272"} I need to convert it into a JSONArray . Any help? By the way, I tried this and it does not work: 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 If you're talking about using the JSON in java library, then since your input string is a JSON object, not a JSON array, you should first