handleBlockResponse

fun handleBlockResponse(response: String, url: String?, callback: (result: HSBotDefenderChallengeResult) -> Unit?): Boolean

This function handles the URL request's response and presents the challenge screen, if necessary. Returns true if the Human's payload in the response was handled by the SDK. This function should be used only when the `HSPolicyUrlRequestInterceptionType` is set to `HSPolicyUrlRequestInterceptionType/NONE` in the policy.

Parameters

response

The response that was received from the URL request.

url

The URL of the request that was blocked.

callback

The callback that indicate the challenge's result. The callback will be called once the user solved (or cancelled) the challenge. You may use this to retry the URL request.


Handles the URL request's response and presents the challenge screen, if necessary. This suspend function is a coroutine-based alternative to handleBlockResponse. It suspends and returns the result once the challenge is solved or canceled. This function is available to Kotlin callers only and is hidden from Java via @JvmSynthetic. Java callers should use the handleBlockResponse method with a callback instead. This function should only be used when the HSPolicyUrlRequestInterceptionType is set to HSPolicyUrlRequestInterceptionType.NONE in the policy.

Return

The result of the challenge interaction.

Parameters

response

The response that was received from the URL request.

url

The URL of the request that was blocked.

Throws

if the response cannot be handled by the SDK. Make sure to call canHandleBlockResponse(response:) before calling this function.