Example usage for com.squareup.okhttp Response toString

List of usage examples for com.squareup.okhttp Response toString

Introduction

In this page you can find the example usage for com.squareup.okhttp Response toString.

Prototype

@Override
    public String toString() 

Source Link

Usage

From source file:org.hawkular.apm.tests.dist.AbstractITest.java

License:Apache License

private Response execute(Request request, Server server) throws IOException {
    System.out.format("---> Request: %s\n", request);
    Response response = client.newCall(request).execute();
    System.out.format("<--- Response: %s\n", response.toString());

    return response;
}

From source file:org.hawkular.datamining.itest.AbstractITest.java

License:Apache License

private Response execute(Request request) throws IOException {
    System.out.format("---> Request: %s\n", request);
    Response response = client.newCall(request).execute();
    System.out.format("<--- Response: %s\n", response.toString());
    return response;
}

From source file:tk.breezy64.pantex.core.Util.java

public static String post(String url, Map<String, String> params) throws IOException {
    OkHttpClient client = getClient(DEFAULT_SESSION);
    FormEncodingBuilder b = new FormEncodingBuilder();
    for (Map.Entry<String, String> e : params.entrySet()) {
        b.add(e.getKey(), e.getValue());
    }/* w  ww . ja  v  a 2  s .  c o  m*/

    Request req = new Request.Builder().post(b.build()).url(url).build();

    Response r = client.newCall(req).execute();
    System.out.println("Result: " + r.toString());
    return r.body().string();
}