implementation using version 4.0 of httpclient