Package com.ning.http.client

Examples of com.ning.http.client.Request


                              .set("access_token", System.getProperty("fb.access_token"))
                              .expand();

      Assert.assertEquals("https://graph.facebook.com/bgolub?fields=id,name,picture&access_token="+System.getProperty("fb.access_token"), uri);
      RequestBuilder builder = new RequestBuilder("GET");
      Request request = builder.setUrl(uri).build();
      executeRequest(createClient(), request);
   }
View Full Code Here


                              .set("access_token", System.getProperty("fb.access_token"))
                              .expand();
      System.out.println(uri);
      Assert.assertEquals("https://graph.facebook.com/bgolub/albums?fields=id,name,count&access_token="+System.getProperty("fb.access_token"), uri);
      RequestBuilder builder = new RequestBuilder("GET");
      Request request = builder.setUrl(uri).build();
      executeRequest(createClient(), request);
   }
View Full Code Here

                              .set("access_token", System.getProperty("fb.access_token"))
                              .expand();

      Assert.assertEquals("https://graph.facebook.com/bgolub?fields=id,name,picture&access_token="+System.getProperty("fb.access_token"), uri);
      RequestBuilder builder = new RequestBuilder("GET");
      Request request = builder.setUrl(uri).build();
      executeRequest(createClient(), request);
   }
View Full Code Here

      Assert.assertEquals(
            "https://graph.facebook.com/search?q=coffee&type=place&center=37.76,-122.427&distance=1000&limit=5&offset=10&access_token="
                  + System.getProperty("fb.access_token"), uri);
      RequestBuilder builder = new RequestBuilder("GET");
      Request request =
            builder.setUrl(UriTemplate.fromTemplate(GRAPH_API_EXPRESSION)
                                      .set("id","search")
                                      .set("q", "coffee")
                                      .set("type","place")
                                      .set("center", new float[] {37.76f,-122.427f})
View Full Code Here

                                     .set("q", "URI Templates")
                                     .set("rpp", "5")
                                     .set("include_entities", true)
                                     .set("result_type", "mixed")
                                     .expand();
      Request request = builder.setUrl(uri).build();
      Assert.assertEquals("http://search.twitter.com/search.json?q=URI%20Templates&result_type=mixed&rpp=5&include_entities=true&result_type=mixed", uri);
      executeRequest(createClient(), request);
   }
View Full Code Here

   public void testUserRepos() throws Exception
   {


      RequestBuilder builder = new RequestBuilder("GET");
      Request request = builder.setUrl(
            UriTemplate.buildFromTemplate(BASE)
                               .literal("/users/{user}/repos")
                               .literal(PAGINATION)
                               .build()
                               .set("user", "damnhandy")
                               .set("repo", "repos")
                               .set("page", 1)
                               .set("per_page", 4)
                               .expand()).build();
      Assert.assertEquals("https://api.github.com/users/damnhandy/repos?page=1&per_page=4", request.getUrl());
      executeRequest(createClient(), request);
   }
View Full Code Here

   public void testCommitsApi() 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")
                               .set("function","commits")
                               .expand()).build();
      Assert.assertEquals("https://api.github.com/repos/damnhandy/Handy-URI-Templates/commits", request.getUrl());
      executeRequest(createClient(), request);
   }
View Full Code Here

   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")
                              .set("function","commits")
                              .set("id","7cdf7ff75f8ede138228ceff7f5a1c18a5835b94")
                              .expand()).build();
      Assert.assertEquals("https://api.github.com/repos/damnhandy/Handy-URI-Templates/commits/7cdf7ff75f8ede138228ceff7f5a1c18a5835b94", request.getUrl());
      executeRequest(createClient(), request);
   }
View Full Code Here

TOP

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

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.