This might be a dumb question but what is the simplest way to read and parse JSON from URL in Java?
In Groovy, it\
It's very easy, using jersey-client, just include this maven dependency:
org.glassfish.jersey.core
jersey-client
2.25.1
Then invoke it using this example:
String json = ClientBuilder.newClient().target("http://api.coindesk.com/v1/bpi/currentprice.json").request().accept(MediaType.APPLICATION_JSON).get(String.class);
Then use Google's Gson to parse the JSON:
Gson gson = new Gson();
Type gm = new TypeToken() {}.getType();
CoinDeskMessage cdm = gson.fromJson(json, gm);