Accessing body string of an OkHttp Response twice results in IllegalStateException: closed
Update: As mugwort points out there is a simpler, more lightweight API available now (see GitHub issue): String responseBodyString = response.peekBody(Long.MAX_VALUE).string(); Log.d(“TAG”, responseBodyString); Original Answer: For explanation of the issue see Greg Ennis’ answer. However, if you can not easily pass the result in a variable, but still need to access the response body twice … Read more