APISonar


io.anuke.mindustry.net.Net.http

> io > anuke > mindustry > net > Net > http
io APIs anuke APIs mindustry APIs net APIs Net APIs http APIs

Example 1
public static void getChangelog(Consumer<Array<VersionInfo>> success, Consumer<Throwable> fail){
        Net.http(releasesURL, "GET", result -> {
            Json j = new Json();
            Array<JsonValue> list = j.fromJson(null, result);
            Array<VersionInfo> out = new Array<>();
            for(JsonValue value : list){
                String name = value.getString("name");
                String description = value.getString("body").replace("\r", "");
                int id = value.getInt("id");
                int build = Integer.parseInt(value.getString("tag_name").substring(1));
                out.add(new VersionInfo(name, description, id, build));
            }
            success.accept(out);
        }, fail);
    }