Game of dice REST API

get

https://app-mego.herokuapp.com/games/dice
Request
Response
Request
Response
200: OK
{
"firstNumber": "1",
"secondNumber": "6",
"url": "https://megolox.ru/disImages/1-6.png"
}

With this REST API, you can do this:

Ready code for interaction:

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);
}

Dependencies for Maven/Gradle: