title: How to call another api from same app in spring boot
body: <p>I have two <code>RestController</code>s for user and Company.</p>
  
  <ul>
  <li><p><code>CompanyController</code>: fetch from and store company information to <code>companies</code> table using service and repo level. </p></li>
  <li><p><code>UsersController</code> : It is used to fetch and store users. </p></li>
  <li><p>Relationship: Each user is associated with company(User hasOne company).</p></li>
  </ul>
  
  <p>When new <code>User</code> get registered, we need to fetch company information by id and associate with user profile.</p>
  
  <p>For this, I have one endpoint in <code>CompanyController</code>, named <code>getCompanyInfo</code>. I have to call that endpoint to fetch company data while saving user profile.</p>
  
  <p>How to call another API from same app in Spring Boot?</p>