0
我無法獲取完整的JSON字符串,如果字符串不顯示最後三個字符。這裏是JSON字符串JSON Exceptionorg.json.JSONException:未終止的字符串
{"status":"success","data":"Screenshot_2016-07-24-13-06-4120160726082711.pn
JSON請求
StringRequest stringRequest = new StringRequest(Request.Method.POST,
url, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
Utils.psLog("Server RESPONSE >> " + response);
JSONObject obj = new JSONObject(response);
}
catch {
}
錯誤日誌
07-26 13:57:11.556 8632-8632/com.directory D/TEAMPS: Server RESPONSE >>
{"status":"success","data":"Screenshot_2016-07-24-13-06-4120160726082711.pn
07-26 13:57:11.557 8632-8632/com.directory D/TEAMPS: JSON Exceptionorg.json.JSONException: Unterminated string at character 78 of
{"status":"success","data":"Screenshot_2016-07-24-13-06-4120160726082711.pn
我知道,但我得到的是這樣而已,順便說一句應該是:'{「status」:「success」,「data」:「Screenshot_2016-07-24-13-06-4120160726082711.png」}' – amit
正確。但是在修復JSON之後,你仍然會遇到同樣的問題? –
嗨@Ricardo,從**服務器**獲得這個不完整的字符串**我該如何解決? – amit