I am trying to reproduce the following curl command using Java:
curl -v -u user:pass http://myapp.com/api
This command returns some JSON da
httpclient v4.0 not Support Preemptive authentication
Look this : http://forum.springsource.org/showthread.php?123385-Preemptive-Basic-Authentication-with-RestTemplate
In spring Source found this solution.
It works for me.
Look this : RestTemplate with Basic Auth in Spring 3.1