title: How to get headers from all responses using retrofit
body: <p>I'm using <code>Retrofit</code> library version 2 with <code>OkHttpClient</code>.</p>
  
  <p>I want to get some header from all responses.</p>
  
  <p>I found one solution with <code>OkClient</code>:</p>
  
  <pre><code>    public class InterceptingOkClient extends OkClient{
      public InterceptingOkClient()
      {
      }
  
      public InterceptingOkClient(OkHttpClient client)
      {
          super(client);
      }
  
      @Override
      public Response execute(Request request) throws IOException
      {
          Response response = super.execute(request);
  
          for (Header header : response.getHeaders())
          {
              // do something with header
          }
  
          return response;
      }
  }
  </code></pre>
  
  <p>But how i can do this if i'm using <code>OkHttpClient</code>?</p>