Switching from Apache HTTP to UrlConnection