bucker
4/23/2015 - 5:40 PM

OkHttp recipe for dummy

OkHttp recipe for dummy

OkHttp recipe

  • Using POST
OkHttpClient client = new OkHttpClient();
String url = "http://youserver.com";
RequestBody body = new FormEncodingBuilder()
    .add("id", id)
    .add("idx", idx)
    .build();
Request request = new Request.Builder()
    .url(url)
    .post(body)
    .addHeader("token", token)
    .build();