pascal_le_merrer
09/18/2020, 10:53 AMval client = HttpClient(Apache) {
install(Auth) {
followRedirects = true
basic {
sendWithoutRequest = true
username = login
password = pwd
}
}
}
runCatching {
client.get<HttpResponse>(AUTH_URL)
}.onSuccess {
client.close()
print(it.headers)
return it.status == HttpStatusCode.OK
}.onFailure {
it.printStackTrace()
client.close()
throw it
}