Have you tried the BASE_URL strategy?
I.e. set up constants in your codebase for different URLs, e.g.:
Copy code
const val BASE_URL = "<http://www.somedomain.com>"
const val PAGE_URL = "$BASE_URL/page"
const val SOME_OTHER_PAGE_URL = "$BASE_URL/someotherpage"
s
steamstreet
03/09/2023, 1:56 AM
I'm parsing html, so I need to support generic urls
s
Shubham Singh
03/09/2023, 2:00 AM
Could we do something similar in that case as well?
i.e.
Copy code
val BASE_URL = fetchedUrl.substringBefore("/")
val PAGE_URL = BASE_URL + "/page"
And so on?
s
steamstreet
03/09/2023, 2:01 AM
Yes, but at that point I'm just going to use the built in jvm classes. Just would prefer to use the cross platform ktor stuff. Seems like it's not supported
s
Shubham Singh
03/09/2023, 2:02 AM
I'm not sure, maybe it is supported, these were just my 2 cents. Maybe someone more experienced should be able to help 👍