Hi. Is there any good multiplatform library for handling URIs?
f
Hi. Is there any good multiplatform library for handling URIs?
a
what sort of handling? Ktor has a URL class, and a builder util
f
I need to be able parse URIs with custom protocols (i.e. not only http/https/ftp) and access its components.
a
there’s an official regex for URIs https://www.rfc-editor.org/rfc/rfc3986#appendix-B - would that work?
f
Probably. I will explore that option. Thanks!
a
just be aware that regex depends on the underlying engine of the target, so it’s not truly multiplatform 😬 https://youtrack.jetbrains.com/issue/KT-49557 But so long as you’re only using the basics, it should be fine.
c
I’ve been using
ktor-http
in my Ballast Navigation library. It does work pretty well, but it’s a very large dependency, bringing in a bunch of other HTTP stuff beyond just URI parsing. I’ve been looking to replace Ktor with this library, which is considerably smaller. At the time that I first released Ballast Navigation, there were some KMP targets I was supporting that it didn’t, but I believe those were the targets that were recently deprecated, so shouldn’t be a problem anymore
863 Views