{"firstNumber": "1","secondNumber": "6","url": "https://megolox.ru/disImages/1-6.png"}
With this REST API, you can do this:
protected static String first = null;protected static String second = null;protected static String url = null;private final static String URL = "https://app-mego.herokuapp.com/games/dice";βpublic static void main(String[] args) throws IOException {βJSONObject json = new JSONObject(IOUtils.toString(new URL(URL), StandardCharsets.UTF_8));first = String.valueOf(json.get("firstNumber"));second = String.valueOf(json.get("secondNumber"));url = String.valueOf(json.get("url"));System.out.println(first + "\n" + second + "\n" + url);}
β