I recently started using Apache’s HttpClient 4, I was previously using version 3 and I discovered there is a vast difference in the APIs between the two versions. None of the documentation I found for HttpClient 4 had a full example of using POST with connection and socket timeout set. From the documentation I did find and the JavaDoc I pieced together this full example. For this code I used httpclient-4.3.2.jar which also needed httpcore-4.3.1.jar. I use IVY for dependency management and this entry in ivy.xml got me what I needed:
Take a look at the Javadoc for RequestConfig.Builder for what other options are available.
If you need to convert the InputStream from the response to a String I have a quick how-to for that.