The apache http client makes this a piece of cake. Check the following tutorial for more details :
http://www.vogella.com/tutorials/ApacheHttpClient/article.html
http://www.mkyong.com/java/how-to-send-http-request-getpost-in-java/
solved convert curl to httpclient post [closed]