code: @Deprecated
  	public static String encodeHttpUrl(String httpUrl, String encoding) throws UnsupportedEncodingException {
  		Assert.notNull(httpUrl, "HTTP URL must not be null");
  		Assert.hasLength(encoding, "Encoding must not be empty");
  		Matcher matcher = HTTP_URL_PATTERN.matcher(httpUrl);
  		if (matcher.matches()) {
  			String scheme = matcher.group(1);
  			String authority = matcher.group(2);
  			String userinfo = matcher.group(4);
  			String host = matcher.group(5);
  			String portString = matcher.group(7);
  			String path = matcher.group(8);
  			String query = matcher.group(10);
  			return encodeUriComponents(scheme, authority, userinfo, host, portString, path, query, null, encoding);
  		}
  		else {
  			throw new IllegalArgumentException("[" + httpUrl + "] is not a valid HTTP URL");
  		}
  	}
docs: Encodes the given HTTP URI into an encoded String. All various URI components are
  encoded according to their respective valid character sets.
  <p><strong>Note</strong> that this method does not support fragments ({@code #}),
  as these are not supposed to be sent to the server, but retained by the client.
  <p><strong>Note</strong> that this method does not attempt to encode "=" and "&"
  characters in query parameter names and query parameter values because they cannot
  be parsed in a reliable way. Instead use:
  <pre class="code">
  UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl("/path?name={value}").buildAndExpand("a=b");
  String encodedUri = uriComponents.encode().toUriString();
  </pre>
  @param httpUrl the HTTP URL to be encoded
  @param encoding the character encoding to encode to
  @return the encoded URL
  @throws IllegalArgumentException when the given uri parameter is not a valid URI
  @throws UnsupportedEncodingException when the given encoding parameter is not supported
  @deprecated in favor of {@link UriComponentsBuilder}; see note about query param encoding