Based on https://code.google.com/p/httpclientandroidlib/, updated for v4.2.5 of Apache HTTP Components.