steamstreet
03/08/2023, 11:51 PM/someotherpage
but short of dissecting the URLs, there doesn’t seem to be a way to create one like there is in the JDK: URL(URL("<http://www.somedomain.com/page>"), "/someotherpage")
Shubham Singh
03/09/2023, 1:56 AMconst val BASE_URL = "<http://www.somedomain.com>"
const val PAGE_URL = "$BASE_URL/page"
const val SOME_OTHER_PAGE_URL = "$BASE_URL/someotherpage"
steamstreet
03/09/2023, 1:56 AMShubham Singh
03/09/2023, 2:00 AMval BASE_URL = fetchedUrl.substringBefore("/")
val PAGE_URL = BASE_URL + "/page"
And so on?steamstreet
03/09/2023, 2:01 AMShubham Singh
03/09/2023, 2:02 AMRustam Siniukov
03/09/2023, 11:01 AMUrlBuilder(baseUrl).takeFrom(relativeUrl)
should do the trick