I have a response coming from the server. When I am trying to convert the String into JSON Object, I am getting an error
Value {
"StatusCode": "000",
"FileURI":"https:///someurl/directory/filename"
} of type java.lang.String cannot be converted to JSONObject
The code that I wrote to parse is:
JSONObject jsonObject = new JSONObject(response);
Where response
is My String that is coming from server:
"{\r\n \"StatusCode\": \"000\",\r\n \"FileURI\": \"https://someurl/directory/filename\"\r\n}"
can anyone help me out why is it not working.