1
If you use a Log
thus rescuing the body of the sponse:
Log.wtf(TAG,""+response.body().string());
Correctly prints the JSON value. Something in this format:
{"error":true,"message":"Login failed. Incorrect credentials"}
But if I insert the object of response.body().string()
in a JSONObject
in this way:
JSONObject jsonObject = new JSONObject(response.body().string());
Gives the following error:
java.io.Ioexception: Content-Length and stream length disagree
What might be going on?