fun RestClient( target: String?, username: String?, password: String?, asyncClient: CloseableHttpAsyncClient? ) { checkNotNull(target, "target cannot be null") checkNotNull(username, "username cannot be null") checkNotNull(password, "password cannot be null") target = target this.clientContext = getHttpClientContext(target, username, password) asyncClient = if (asyncClient == null) getHttpClient() else asyncClient }
Constructs a RestClient .