Error: Content-Length and stream length disagree

Asked

Viewed 130 times

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?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.