Being in need to issue POST requests from within a Java application, and wanting re-usable code, I created a very simple Java library for issuing POST and GET requests to a remote server.
POST source code – GET source code
Usage (POST example):
POST post = new POST(); post.postRequest("http://www.myservice.com/service", "param1=foo¶m2=bar", "Mozilla/5.0");
In other words, the arguments are:
post.postRequest(SERVER_URL, PARAMETERS, AGENT);
The output can be manipulated as desired, depending on what you response you except you should use a corresponding element/object.