https://kotlinlang.org logo
Title
n

natario1

05/31/2022, 6:47 PM
We’ve been using
defaultRequest { }
to configure the base URL for our backend, like https://backend.com , then do things like
get("users")
. If the base url has a segment though, like https://backend.com/v1 . v1 is ignored in
get("users")
will still hit https://backend.com/users. I kind of get why this happens but is there any way to make it work?
e

e5l

05/31/2022, 6:47 PM
Could you try
<https://backend.com/v1/>
instead?
👍 1
n

natario1

05/31/2022, 6:54 PM
Hmm yeah it works! As long as I use get(“users”) and not get(“/users”). A bit tricky but thanks a lot!
e

e5l

05/31/2022, 6:55 PM
Awesome! will add to the docs
r

Rustam Siniukov

05/31/2022, 7:03 PM
Actually, it’s in API docs for
DefaultRequest
plugin
👍 1