utility.URLBuilder.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of baku Show documentation
Show all versions of baku Show documentation
helps you focus your REST API back-end on the business logic
package com.github.fluidsonic.baku
import io.ktor.http.URLBuilder
import io.ktor.http.encodeURLQueryComponent
fun URLBuilder.appendPath(vararg components: String) =
appendPath(components.toList())
fun URLBuilder.appendPath(components: List): URLBuilder {
encodedPath += components.joinToString(
separator = "/",
prefix = if (encodedPath.endsWith('/')) "" else "/"
) { it.encodeURLQueryComponent() }
return this
}