Several enhancements, as follows:

 * partial match with User-Agent
 * migrating to HttpClient 4
 * proper handling of request and response headers