docs: private String encode(String value, boolean query) {
      if (this.encode.isEncodingRequired()) {
        return query ? UriUtils.queryEncode(value, this.charset)
            : UriUtils.pathEncode(value, this.charset);
      } else {
        return value;
      }
    }