1. Fix credentials provider setting.
   apache httpclient 4 used a different
   mechanism (DefaultHttpClient.setCredentialsProvider)
   to set credentials provider.
2. In apache httpclient 4, if one extracts
   the body of a method as, for example, a string,
   then accessing it again as a stream will fail.
   Fixed.