ribesg
04/15/2019, 12:42 PMprivate val buildersRequiringAuth: MutableSet<HttpRequestBuilder> = HashSet()
/**
* Setups the Authentication header of this request.
*/
fun HttpRequestBuilder.useAuthentication() {
buildersRequiringAuth.add(this)
@Suppress("EXPERIMENTAL_API_USAGE")
executionContext.invokeOnCompletion {
buildersRequiringAuth.remove(this)
}
}
internal val HttpRequestBuilder.usesAuthentication: Boolean
get() = this in buildersRequiringAuth