This is a call of `String.toString` so either `URLEncoder.encode("$it", "UTF-8")` or `URLEncoder.encode(it.toString(), "UTF-8")` will do, also there is additional whitespace inside the `()`s