0

How can I get what my api url is hitting in retrfit, I want to check what is my request url is generating in kotlin android.

Nish Lamba
  • 11
  • 2

1 Answers1

0

In your Retrofit client you should add a specific interceptor to do this.

val loggingInterceptor = HttpLoggingInterceptor().setLevel(Level.BODY)
val retrofitClient = Builder()
    .addInterceptor(loggingInterceptor)
    .build()

Interceptors have a lot a levels to determine how verbose the logs should be, check Retrofit's documentation for further information

Diego Marcher
  • 378
  • 3
  • 7