Added in API level 21

WebResourceRequest

interface WebResourceRequest
android.webkit.WebResourceRequest

Encompasses parameters to the android.webkit.WebViewClient#shouldInterceptRequest method.

Summary

Public methods
abstract String!

Gets the method associated with the request, for example "GET".

abstract MutableMap<String!, String!>!

Gets the headers associated with the request.

abstract Uri!

Gets the URL for which the resource request was made.

abstract Boolean

Gets whether a gesture (such as a click) was associated with the request.

abstract Boolean

Gets whether the request was made in order to fetch the main frame's document.

abstract Boolean

Gets whether the request was a result of a server-side redirect.

Public methods

getMethod

Added in API level 21
abstract fun getMethod(): String!

Gets the method associated with the request, for example "GET".

Return
String! the method associated with the request.

getRequestHeaders

Added in API level 21
abstract fun getRequestHeaders(): MutableMap<String!, String!>!

Gets the headers associated with the request. These are represented as a mapping of header name to header value.

Return
MutableMap<String!, String!>! the headers associated with the request.

getUrl

Added in API level 21
abstract fun getUrl(): Uri!

Gets the URL for which the resource request was made.

Return
Uri! the URL for which the resource request was made.

hasGesture

Added in API level 21
abstract fun hasGesture(): Boolean

Gets whether a gesture (such as a click) was associated with the request. For security reasons in certain situations this method may return false even though the sequence of events which caused the request to be created was initiated by a user gesture.

Return
Boolean whether a gesture was associated with the request.

isForMainFrame

Added in API level 21
abstract fun isForMainFrame(): Boolean

Gets whether the request was made in order to fetch the main frame's document.

Return
Boolean whether the request was made for the main frame document. Will be false for subresources or iframes, for example.

isRedirect

Added in API level 24
abstract fun isRedirect(): Boolean

Gets whether the request was a result of a server-side redirect.

Return
Boolean whether the request was a result of a server-side redirect.