title: Convert Curl command into Java/Android
body: <p>I am developing two applications - </p>
  
  <p>First one is web application using Spring MVC 3</p>
  
  <p>And the second one is an Android application for same web application.</p>
  
  <p>In both, I am integrating basic authentication to authenticate user on that site using the APIs.</p>
  
  <p>In the API tutorial, following curl command is given to authenticate user -</p>
  
  <p><strong>$ curl -u username:password insert_Url_here -d '[xml body here]'</strong></p>
  
  <p>I am not getting, how to convert this command in Java and android code.</p>
  
  <p>Please guide me. I am totally stuck here.</p>