okhttp / okhttp3 / HttpUrl / toUri

toUri

@JvmName("uri") fun toUri(): URI

Returns this URL as a java.net.URI. Because URI is more strict than this class, the returned URI may be semantically different from this URL:

These differences may have a significant consequence when the URI is interpreted by a web server. For this reason the URI class and this method should be avoided.