code: public String asString() throws IOException {
      long len = getContentLength();
      ByteArrayOutputStream buf;
      if (0 < len) {
        buf = new ByteArrayOutputStream((int) len);
      } else {
        buf = new ByteArrayOutputStream();
      }
      writeTo(buf);
      return decode(buf.toByteArray(), getCharacterEncoding());
    }
docs: Return a copy of the result as a String.
  
  <p>The default version of this method copies the result into a temporary byte array and then
  tries to decode it using the configured encoding.
  
  @return string version of the result.
  @throws IOException if the data cannot be produced or could not be decoded to a String.