Examples of json()


Examples of us.monoid.web.Resty.json()

      json.put("client_secret", properties.get("auth0.client_secret"));
      json.put("redirect_uri", req.getRequestURL().toString());
      json.put("grant_type", "authorization_code");
      json.put("code", authorizationCode);

      JSONResource tokenInfo = resty.json(tokenUri, content(json));
      return new Tokens(tokenInfo.toObject());

    } catch (Exception ex) {
      throw new IllegalStateException("Cannot get Token from Auth0", ex);
    }
View Full Code Here

Examples of us.monoid.web.Resty.json()

    Resty resty = createResty();

    String userInfoUri = getUserInfoUri(tokens.getAccessToken());

    try {
      JSONResource json = resty.json(userInfoUri);
      return new Auth0User(json.toObject());
    } catch (Exception ex) {
      throw new IllegalStateException("Cannot get User from Auth0", ex);
    }
  }
View Full Code Here

Examples of us.monoid.web.Resty.json()

  /** Getting the Google Developer calendar feed as JSON and following to the first entry, which is an XML resource:
*/
  @Test
  public void jsonToXml() throws Exception {
    Resty r = new Resty();
    String title = r.json("http://www.google.com/calendar/feeds/developer-calendar@google.com/public/full?alt=json").
      xml(path("feed.entry[0].id.$t")).get("entry/title/text()", String.class);
    assertNotNull(title);
    System.out.println(title);
  }
}
View Full Code Here

Examples of us.monoid.web.Resty.json()

  /** Getting the Google Developer calendar feed as JSON and following to the first entry, which is an XML resource:
*/
  @Test
  public void jsonToXml() throws Exception {
    Resty r = new Resty();
    String title = r.json("http://www.google.com/calendar/feeds/developer-calendar@google.com/public/full?alt=json").
      xml(path("feed.entry[0].id.$t")).get("entry/title/text()", String.class);
    assertNotNull(title);
    System.out.println(title);
  }
}
View Full Code Here

Examples of us.monoid.web.Resty.json()

    System.setProperty("content.types.user.table","src/test/java/us/monoid/web/mimecap.properties");
  }
  @Test
  public void sampleUse() throws Exception {
    Resty r = new Resty();
    assertEquals(r.json(getClass().getResource("test.json").toString()).json(path("key.subkey")).object().getInt("secret"), 42);
  }

//  @Test
//  public void geoNames() throws Exception {
//    Resty r = new Resty();
View Full Code Here

Examples of us.monoid.web.Resty.json()

    System.setProperty("content.types.user.table","src/test/java/us/monoid/web/mimecap.properties");
  }
  @Test
  public void sampleUse() throws Exception {
    Resty r = new Resty();
    assertEquals(r.json(getClass().getResource("test.json").toString()).json(path("key.subkey")).object().getInt("secret"), 42);
  }

//  @Test
//  public void geoNames() throws Exception {
//    Resty r = new Resty();
View Full Code Here

Examples of us.monoid.web.jp.javacc.JSONPathCompiler.json()

  }
 
  JSONPathCompiler.JSONPathExpr parse(String path) throws ParseException {
    java.io.StringReader r = new java.io.StringReader(path);
    JSONPathCompiler app = new JSONPathCompiler(r);
    JSONPathCompiler.JSONPathExpr x = JSONPathCompiler.JSONPathExpr.class.cast(app.json());
    x.dump(" ");
    return x;
  }

  JSONObject read(URL testFile) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.