main.name.remal.gradle_plugins.utils.retrofit2.Retrofit.Builder.kt Maven / Gradle / Ivy
package name.remal.gradle_plugins.utils
import okhttp3.HttpUrl
import retrofit2.Retrofit
import java.net.URI
fun Retrofit.Builder.baseUrl(uri: URI) = baseUrl(HttpUrl.get(uri) ?: throw IllegalArgumentException("Not a valid HTTP URI: $uri"))
fun Retrofit.Builder.create(service: Class): T {
return build().create(service)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy