(String url, String json)
| 28 | final OkHttpClient client = new OkHttpClient(); |
| 29 | |
| 30 | String post(String url, String json) throws IOException { |
| 31 | RequestBody body = RequestBody.create(json, JSON); |
| 32 | Request request = new Request.Builder() |
| 33 | .url(url) |
| 34 | .post(body) |
| 35 | .build(); |
| 36 | try (Response response = client.newCall(request).execute()) { |
| 37 | return response.body().string(); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | String bowlingJson(String player1, String player2) { |
| 42 | return "{'winCondition':'HIGH_SCORE'," |