title: Debuggin Retrofit 2 - Expected BEGIN_OBJECT but was STRING at line 1 column 1 path
body: <p>I'm getting this error: </p>
  
  <pre><code>Expected BEGIN_OBJECT but was STRING at line 1 column 1 path
  </code></pre>
  
  <p>In another stackoverflow question, they say I am receiving an array when it should be an object.
  But my intuition is that I am receiving nothing, but I'm not able to see my json to debug.</p>
  
  <p>I'm trying to log my received json to see what's happening, because I don't see the error in my code.</p>
  
  <p>I coded is mentioned <a href="https://stackoverflow.com/questions/32514410/logging-with-retrofit-2">here</a>: </p>
  
  <pre><code>OkHttpClient client = new OkHttpClient();
  
      client.interceptors().add(new Interceptor() {
          @Override
          public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
              Request request = chain.request();
              Buffer buffer = new Buffer();
              request.body().writeTo(buffer);
              String body = buffer.readUtf8();
              Request.Builder builder = chain.request().newBuilder();
              String credential = Credentials.basic(user, pass);
              builder.addHeader("Authorization", credential).build();
              Response response = chain.proceed(builder.build());
              return response;
          }
      });
      return client;
  </code></pre>
  
  <p>But I get a NullPointerException in <code>request.body()</code>...</p>
  
  <p>What's my next step for debugging???</p>