title: Call REST API from another project
body: <p>I have two projects one for user and another for department.</p>
  
  <p>Now I want to call a REST API from another REST API. How can I call?</p>
  
  <p>I am facing problem because user related classes are not available for department and vice versa.</p>
  
  <p>This is my UserController class.</p>
  
  <pre><code>@RestController
  @RequestMapping("/user")
  public class UserController {
      @Autowired   
      UserService userService;
      @GetMapping(value="/get", headers="Accept=application/json")
      public List&lt;User&gt; getAllUser() {
          List&lt;User&gt; tasks=userService.getUser();
          return tasks;
      }
  </code></pre>
  
  <p>And this is my DepartmentController class.</p>
  
  <pre><code>@RestController
  @RequestMapping("/dept")
  @Configurable
  public class DeptController {
  @Autowired
      DeptServiceImpl deptService;
  @GetMapping(value="/get", headers="Accept=application/json")
          public List&lt;User&gt; getDept() {
              List&lt;Department&gt; tasks=deptService.getDept();
              return tasks;
          }
  </code></pre>
  
  <p>Please tell me how to call getUser() method in getDept(), and how to make classes available for each other.</p>