title: Spring RestTemplate getForObject() giving 401 unauthorized exception
body: <p>In my browser follwing rest API url is working and I can see XML results.</p>
  
  <pre><code>"http://V7846EKZZJ1OJAW486D66IS7GO24XKUZ@localhost:8090/prestashop/api/products/1"
  </code></pre>
  
  <p>I want to call this url from Java client and get results. For that I am using RestTemplate.</p>
  
  <pre><code>String result = restTemplate.getForObject("http://V7846EKZZJ1OJAW486D66IS7GO24XKUZ@localhost:8090/prestashop/api/products/1"
      , String.class);
  </code></pre>
  
  <p>this is giving following error,</p>
  
  <pre><code>WARNING: GET request for       http://V7846EKZZJ1OJAW486D66IS7GO24XKUZ@localhost:8090/prestashop/api/products/1 resulted in 401 (Unauthorized); invoking error handler
  Disconnected from the target VM, address: '127.0.0.1:49533', transport: 'socket'
  
  org.springframework.web.client.HttpClientErrorException: 401 Unauthorized
  at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:88)
  at org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:537)
  </code></pre>
  
  <p>Not sure why this is happening. 
  Can't we call URL in form username@host/appplication with RestTemplate?
  Or is it incorrect the way I am calling this URL with RestTemplate?</p>
  
  <p>regards,
  -Lasith.</p>