code: private static String formatRequest(String url, String key, String phrase, String conversationID)
      {
          String formattedPhrase = phrase.replaceAll("\\s+", "+");
          return String.format("%s%s&input=%s&wrapper=Headline22JavaAPI%s", url, key, formattedPhrase, ((conversationID.equals("")) ? "" : ("&cs=" + conversationID)));
      }
docs: URL request formater
  
  @param url starting url to connect to
  @param key API key (cleverbot.com/api)
  @param phrase input to be sent to CleverBot servers
  @param conversationID unique conversation identifer
  @return String object containing properly formatted URL