ArenaService.TestRest.java Source code

Java tutorial

Introduction

Here is the source code for ArenaService.TestRest.java

Source

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ArenaService;

import org.springframework.web.client.RestTemplate;

/**
 *
 * @author wouteradriaens
 */
public class TestRest {

    public static void main(String[] args) {
        RestTemplate restTemplate = new RestTemplate();
        Arenas response = restTemplate.getForObject(
                "https://api.worldoftanks.eu/wot/encyclopedia/arenas/?application_id=102bb26eb57f82e3b28572f345fef266",
                Arenas.class);
        for (Arena a : response.getData().values()) {
            System.out.println("Map: " + a.getName_i18n());
        }
        // System.out.println(response.getData());
        //String response = restTemplate.getForObject("https://api.worldoftanks.eu/wot/encyclopedia/arenas/?application_id=102bb26eb57f82e3b28572f345fef266", String.class);
        //System.out.println("Response: " + response);
    }

}