OkHttp Profiler

Compatible with: IntelliJ IDEA Android Studio
Nov 12, 2018
827

The OkHttp Profiler plugin can show detail request information from the OkHttp library directly in the Android Studio toolwindow.

Also, you can easily create a Java/Kotlin model from the response data. Just click the right mouse button on a root element of the tree (or any other), choose Java or Kotlin, and select a folder for a new file in the project.

It supports OkHttp v3 (http://square.github.io/okhttp/) or Retrofit v2 (https://square.github.io/retrofit/)

Works ONLY with ANDROID

More details by link: https://github.com/itkacher/OkHttpProfiler

Download plugin

Recent change notes

Copy request as cURL command

General usage instructions


For activating you need to include library to your app build.gradle file
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.4' 
The latest version: and add Interceptor to okHttpClient in code For OkHttp Java

    OkHttpClient.Builder builder = new OkHttpClient.Builder();
     if (BuildConfig.DEBUG) {
         builder.addInterceptor(new OkHttpProfilerInterceptor());
     }   
    OkHttpClient client = builder.build(); 

Kotlin

    val builder = OkHttpClient.Builder()
    if (BuildConfig.DEBUG) {
        builder.addInterceptor(OkHttpProfilerInterceptor() )
    }    
    val client = builder.build()
For Retrofit Java

    OkHttpClient.Builder builder = new OkHttpClient.Builder();
     if (BuildConfig.DEBUG) {
         builder.addInterceptor(new OkHttpProfilerInterceptor());
     }   
    OkHttpClient client = builder.build(); 
    Retrofit retrofit = new Retrofit.Builder()
                ......
                .client(client)
                .build();
Kotlin

    val builder = OkHttpClient.Builder()
    if (BuildConfig.DEBUG) {
        builder.addInterceptor( OkHttpProfilerInterceptor() )
    }    
    val client = builder.build()
    val retrofit = Retrofit.Builder()
            ......
            .client(client)
            .build()
More details by link: https://github.com/itkacher/OkHttpProfiler