Package fi.luomus.commons.json

Examples of fi.luomus.commons.json.JSONObject


 
  @Test
  public void contentAsJson() throws ClientProtocolException, IOException {
    client = new HttpClientService();
    HttpGet request = new HttpGet("http://ws.luomus.fi/util/coordinate-conversion-service?lat=6663841&lon=333229&type=trs-tm35fin&format=json");
    JSONObject json = client.contentAsJson(request);
    Assert.assertEquals(1, json.getKeys().length);
    Assert.assertEquals("conversion-response", json.getKeys()[0]);
  }
View Full Code Here


   * @throws ClientProtocolException
   * @throws IOException
   */
  public JSONObject contentAsJson(HttpUriRequest request) throws ClientProtocolException, IOException {
    String response = contentAsString(request);
    JSONObject json = new JSONObject(response);
    return json;
  }
View Full Code Here

TOP

Related Classes of fi.luomus.commons.json.JSONObject

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.