public static String encode(String string) {
      byte[] bytes;
      try {
        bytes = string.getBytes(PREFERRED_ENCODING);
      } catch (UnsupportedEncodingException e) {
        bytes = string.getBytes();
      }
      return encodeBytes(bytes);
    }
Encode string as a byte array in Base64 annotation.

@param string
@return The Base64-encoded data as a string
lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java