spring-guides / gs-consuming-rest

Consuming a RESTful Web Service :: Learn how to retrieve web page data with Spring's RestTemplate.
https://spring.io/guides/gs/consuming-rest/
Apache License 2.0
195 stars 287 forks source link

Typo in pom.xml example #29

Closed Cvetomird91 closed 5 years ago

Cvetomird91 commented 5 years ago

Hello,

There's a typo in the Maven import in the Maven file:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
    </dependency>

The "boot" package is missing here.

gregturn commented 5 years ago

spring-web is the module from the Spring Framework that contains RestTemplate, which is used in the guide:

@Bean
public CommandLineRunner run(RestTemplate restTemplate) throws Exception {
    return args -> {
        Quote quote = restTemplate.getForObject(
                "http://gturnquist-quoters.cfapps.io/api/random", Quote.class);
        log.info(quote.toString());
    };
}