0

Speedy(SPDY)に対応したAndroidクライアントのシンプルなアプリを作りたいのですが、本当に行き詰っています。

作成中のアプリでは OkHttp の v2.0.0 JAR を使用しています。次のコードを使用しました(ここから取得):

package com.squareup.okhttp.guide;

import com.squareup.okhttp.OkHttpClient;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import java.io.IOException;

public class GetExample {
  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();
  }

  public static void main(String[] args) throws IOException {
    GetExample example = new GetExample();
    String response = example.run("https://raw.github.com/square/okhttp/master/README.md");
    System.out.println(response);
  }
}

ここでのnextCall()メソッドは実行されません。メソッドがクラスnextCall()に存在しないと繰り返し言っています。OkHttpClient

4

0 に答える 0