All Downloads are FREE. Search and download functionalities are using the official Maven repository.

utility.URLBuilder.kt Maven / Gradle / Ivy

There is a newer version: 0.9.27
Show newest version
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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy