title: How do I Use Rest Template with the Spring Boot CLI?
body: <p>I have the following code...</p>
  
  <pre><code>@Grab(
      group='org.springframework', 
      module='spring-web', 
      version='5.0.4.RELEASE'
  )
  @RestController
  public class MainEndpoint{
      @GetMapping("/")
      String home() {
          RestTemplate restTemplate = new RestTemplate();
          restTemplate.getForObject(
              "http://www.gutenberg.org/ebooks/3725.txt.utf-8", 
              String.class
          )
      }
  }
  </code></pre>
  
  <p>But when I run this I get</p>
  
  <p>Output:</p>
  
  <pre><code>unable to resolve class RestTemplate 
  </code></pre>
  
  <p>Do I need an import or something? I thought SpringBoot handled all that in the background.</p>
  
  <p>How do I use RestTemplate with the spring Boot Cli?</p>