Getting an error Using 'body(): ResponseBody?' is an error. moved to val with okhttp
问题 Using response.body() gives me an error of "Using 'body(): ResponseBody?' is an error. moved to val" i tried removing ? but nothing works the error is in body() override fun onResponse(call: Call, response: Response) { val body = response.body()?.string(); println(body) println("Sucees") 回答1: It looks like you're using OkHttp 4.0.0. The response.body() function has been deprecated. Instead, you need to access the body as a val, like this: override fun onResponse(call: Call, response: Response