Package com.ning.http.client

Examples of com.ning.http.client.RequestBuilder


   @Test
   public void testCommitsApiWithSpecificCommit() throws Exception
   {


      RequestBuilder builder = new RequestBuilder("GET");
      Request request = builder.setUrl(
            UriTemplate.buildFromTemplate(BASE)
                              .literal(PATH_EXPRESSION)
                              .build()
                              .set("user", "damnhandy")
                              .set("repo", "Handy-URI-Templates")
View Full Code Here


            throw new ZenDeskException(e.getMessage(), e);
        }
    }

    private Request req(String method, Uri template) {
        RequestBuilder builder = new RequestBuilder(method);
        if (realm != null) {
            builder.setRealm(realm);
        }
        builder.setUrl(template.toString());
        return builder.build();
    }
View Full Code Here

        builder.setUrl(template.toString());
        return builder.build();
    }

    private Request req(String method, Uri template, String contentType, String body) {
        RequestBuilder builder = new RequestBuilder(method);
        if (realm != null) {
            builder.setRealm(realm);
        }
        builder.setUrl(template.toString());
        builder.addHeader("Content-type", contentType);
        builder.setBody(body);
        return builder.build();
    }
View Full Code Here

        builder.setBody(body);
        return builder.build();
    }

    private Request req(String method, Uri template, String contentType, byte[] body) {
        RequestBuilder builder = new RequestBuilder(method);
        if (realm != null) {
            builder.setRealm(realm);
        }
        builder.setUrl(template.toString());
        builder.addHeader("Content-type", contentType);
        builder.setBody(body);
        return builder.build();
    }
View Full Code Here

        builder.setBody(body);
        return builder.build();
    }

    private Request req(String method, Uri template, int page) {
        RequestBuilder builder = new RequestBuilder(method);
        if (realm != null) {
            builder.setRealm(realm);
        }
        builder.addQueryParameter("page", Integer.toString(page));
        builder.setUrl(template.toString());
        return builder.build();
    }
View Full Code Here

            throw new TransportException(e);
        }
    }

    public WebResponse get() {
        return simpleRequest((new RequestBuilder("GET")).setUrl(url));
    }
View Full Code Here

    public WebResponse get() {
        return simpleRequest((new RequestBuilder("GET")).setUrl(url));
    }

    public WebResponse post(T t) {
        return request((new RequestBuilder("POST")).setUrl(url), t);
    }
View Full Code Here

    public WebResponse post(T t) {
        return request((new RequestBuilder("POST")).setUrl(url), t);
    }

    public WebResponse put(T t) {
        return request((new RequestBuilder("PUT")).setUrl(url), t);
    }
View Full Code Here

    public WebResponse put(T t) {
        return request((new RequestBuilder("PUT")).setUrl(url), t);
    }

    public WebResponse delete() {
        return simpleRequest((new RequestBuilder("DELETE")).setUrl(url));
    }
View Full Code Here

TOP

Related Classes of com.ning.http.client.RequestBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.