https://kotlinlang.org logo
#http4k
Title
# http4k
n

Nezteb

05/17/2019, 8:45 PM
When using
Path.of("something")
and a url is hit like
/api/users/<something>
when i receive the value is it already url decoded? i.e spaces changed from
%20
to just
s

s4nchez

05/18/2019, 1:27 AM
@Nezteb yes, the value is already URL decoded. That's because of how
UriTemplate
works:
Copy code
val extracted = UriTemplate.from("path/{band}").extract("path/Earth%2C%20Wind%20%26%20Fire")
        assertThat(extracted.getValue("band"), equalTo("Earth, Wind & Fire"))
👍 1