ok, così funziona:
garzie!codice:public class Main { public static void main(String[] args) { try { String strUrl = "https://httpbin.org/get"; HttpClient client = HttpClientBuilder.create().build(); HttpGet request = new HttpGet(strUrl); HttpResponse response = client.execute(request); String json = IOUtils.toString(response.getEntity().getContent(), "UTf-8"); JSONObject obj = new JSONObject(json); System.out.println(obj.get("url")); } catch (IOException ex) { System.out.println(ex.getMessage()); } } }
![]()

Rispondi quotando
