Change base URL during runtime #769
-
|
Hi, |
Beta Was this translation helpful? Give feedback.
Answered by
ag2s20150909
Feb 15, 2025
Replies: 1 comment 1 reply
-
|
you can try client.plugin.plugin(HttpSend).intercept { request ->
val originUrl=request.url.buildString()
if (originUrl.startsWith(BASE_URL)){
request.url(Url(originUrl.replaceFirst(BASE_URL, "your new base url")))
}
execute(request)
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jnocz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can try
https://ktor.io/docs/client-http-send.html