This message was deleted.
# chucker
s
This message was deleted.
s
Edit I've created a another OkHttp intercepter and registered it before any other intercepter so other intercepter should receive a modified response as a input from OkHttp
Copy code
class ApiResponseInterceptor : Interceptor {
    @Throws(IOException::class)
    override fun intercept(chain: Interceptor.Chain): Response {
        val request: Request = chain.request()
        val response: Response = chain.proceed(request)
        if (response.code == 200) {
            val jsonObject = JSONObject()
            try {
                jsonObject.put("code", 200)
                jsonObject.put("status", "OK")
                jsonObject.put("message", "Successful")

                val contentType = response.body!!.contentType()
                val body: ResponseBody = ResponseBody.create(contentType, jsonObject.toString())
                return response.newBuilder().body(body).build()
            } catch (e: JSONException) {
                e.printStackTrace()
            }
        } else if (response.code == 403) {
        }
        return response
    }
}
But still Chucker showing original server response in UI
c
I don't really know what you're asking but interceptor order matters. so if you have an interceptor that does decreyption... then add chucker after that interceptor