title: org.springframework.web.client.HttpClientErrorException: 401 null
body: <p>I am calling a service from one module to another module. but it throws an exception:</p>
  
  <blockquote>
    <p>org.springframework.web.client.HttpClientErrorException: 401 null  </p>
    
    <p>POST request for "<a href="http://localhost:80../.../...Report" rel="nofollow noreferrer">http://localhost:80../.../...Report</a>" resulted in 401
    (null); invoking error handler.</p>
  </blockquote>
  
  <p>I can able to hit this service from post man directly.
  But when its called from spring boot module it throws error. </p>
  
  <pre><code>BaseResponseDTO baseResponseDTO = restTemplate.postForObject("http://localhost:80../.../...Report", requestDTO, BaseResponseDTO.class);
  </code></pre>
  
  <p>error throws in this line</p>