What is the difference between the OkHttp methods .toString() and .string()?
问题 I have a snippet of code: override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) { try { Log.d("DEBUG POST=====>", response.body()!!.string()) }catch(e:IOException) { e.printStackTrace() } } When I use response.body()!!.string() I get the correct output, and JSON body. When I use: response.body().toString() I get okhttp3.ResponseBody$1@c626d25 Can anyone kindly tell me what is the difference between the two methods? 回答1: string() isn't a valid Kotlin (or Java)