Okhttp3 中请求回调的数据response.body().toString()取不到数据

时间:2024-03-12 22:01:44

Okhttp3 中请求回调的数据response.body().toString()取不到数据

okhttp --response.body().toString()   获取不到json字符串,我一直以为是请求问题或者解析错误,因为开始一直报的是解析错误,JSONObject和Gson都失败以后又去看,最后看到一个okhttp --response.body().string()  试了一下,成功了

                                                Okhttp3 中请求回调的数据response.body().toString()取不到数据Okhttp3 中请求回调的数据response.body().toString()取不到数据