Skip to content

Instantly share code, notes, and snippets.

@bastman
Last active January 11, 2019 14:34
Show Gist options
  • Save bastman/130af8a7048c017953be08f5da3bb01e to your computer and use it in GitHub Desktop.
Save bastman/130af8a7048c017953be08f5da3bb01e to your computer and use it in GitHub Desktop.
http4-client: basic auth
private val lowLevelClient = OkHttp() // ApacheClient()
private val client = ClientFilters.BasicAuth(
user = config.apiUser, password = config.apiPassword
).then(lowLevelClient)
@PreDestroy
fun preDestroy() {
logger.info { "CLOSE http client" }
lowLevelClient.close()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment