Запрос отправлен: -
@POST("config")
fun postApi(@Body jsonBody: JSONObject): Call<ResponseBody>
Я получаю текст ответа, как показано ниже: -
{"Response":{"Error":[{"message":"Error parsing JSON: unexpected token: bracket. (15360)\nUnable to infer Temp-Table or dataset schema from JSON Data. (15374)"}]}}
Обратный звонок Метод: -
call?.enqueue(object : Callback<ResponseBody> {
override fun onResponse(call: Call<ResponseBody>, response: Response<ResponseBody>) {
if (response.body() != null) {
Log.e("BASE_URL isSuccess : ", response.isSuccessful.toString())
Log.e("BASE_URL response : ", response.body()!!.string())
} else {
Log.e("failed", response.isSuccessful.toString())
}
}
override fun onFailure(call: Call<ResponseBody>, t: Throwable) {
Log.e("onFailure", t.printStackTrace().toString())
}
})