title: How does OkHttp get Json string?
body: <p><strong><em>Solution</em></strong>:
  It was a mistake on my side.</p>
  
  <p>The right way is <strong>response.body().string()</strong> other than <strong>response.body.toString()</strong></p>
  
  <p>Im using Jetty servlet, the URL is<code>http://172.16.10.126:8789/test/path/jsonpage</code>, every time request this URL it will return </p>
  
  <pre><code>{"employees":[
      {"firstName":"John", "lastName":"Doe"}, 
      {"firstName":"Anna", "lastName":"Smith"},
      {"firstName":"Peter", "lastName":"Jones"}
  ]}
  </code></pre>
  
  <p>It shows up when type the url into a browser, unfortunately it shows kind of memory address other than the json string when I request with <code>Okhttp</code>.</p>
  
  <pre><code>TestActivity﹕ com.squareup.okhttp.internal.http.RealResponseBody@537a7f84
  </code></pre>
  
  <p>The Okhttp code Im using:</p>
  
  <pre><code>OkHttpClient client = new OkHttpClient();
  
  String run(String url) throws IOException {
    Request request = new Request.Builder()
        .url(url)
        .build();
  
    Response response = client.newCall(request).execute();
    return response.body().string();
  }
  </code></pre>
  
  <p>Can anyone helpe?</p>