We’ve been using `defaultRequest { }` to configure...
# ktor
n
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
Could you try
<https://backend.com/v1/>
instead?
👍 1
n
Hmm yeah it works! As long as I use get(“users”) and not get(“/users”). A bit tricky but thanks a lot!
e
Awesome! will add to the docs
r
Actually, it’s in API docs for
DefaultRequest
plugin
👍 1