spring-framework / org.springframework.web.util / UriUtils / encodeQueryParam

encodeQueryParam

open static fun encodeQueryParam(queryParam: String, encoding: String): String

Encode the given URI query parameter with the given encoding.

Parameters

queryParam - the query parameter to be encoded

encoding - the character encoding to encode to

Exceptions

UnsupportedEncodingException - when the given encoding parameter is not supported

Return
the encoded query parameter

open static fun encodeQueryParam(queryParam: String, charset: Charset): String

Encode the given URI query parameter with the given encoding.

Parameters

queryParam - the query parameter to be encoded

charset - the character encoding to encode to

Return
the encoded query parameter

Since
5.0