this class should probably be renamed to HttpURLConnectionFactory.