public interface Fetch
| Modifier and Type | Method and Description |
|---|---|
void |
continueRequest(String requestId)
Continues the request, optionally modifying some of its parameters.
|
void |
continueRequest(String requestId,
String url,
String method,
String postData,
List<HeaderEntry> headers)
Continues the request, optionally modifying some of its parameters.
|
void |
continueWithAuth(String requestId,
AuthChallengeResponse authChallengeResponse)
Continues a request supplying authChallengeResponse following authRequired event.
|
void |
disable()
Disables the fetch domain.
|
void |
enable()
Enables issuing of requestPaused events.
|
void |
enable(List<RequestPattern> patterns,
Boolean handleAuthRequests)
Enables issuing of requestPaused events.
|
void |
failRequest(String requestId,
ErrorReason errorReason)
Causes the request to fail with specified reason.
|
void |
fulfillRequest(String requestId,
Integer responseCode,
List<HeaderEntry> responseHeaders)
Provides response to the request.
|
void |
fulfillRequest(String requestId,
Integer responseCode,
List<HeaderEntry> responseHeaders,
String body,
String responsePhrase)
Provides response to the request.
|
ResponseBody |
getResponseBody(String requestId)
Causes the body of the response to be received from the server and returned as a single string.
|
EventListener |
onAuthRequired(EventHandler<AuthRequired> eventListener)
Issued when the domain is enabled with handleAuthRequests set to true.
|
EventListener |
onRequestPaused(EventHandler<RequestPaused> eventListener)
Issued when the domain is enabled and the request URL matches the specified filter.
|
String |
takeResponseBodyAsStream(String requestId)
Returns a handle to the stream representing the response body.
|
void disable()
void enable()
void enable(List<RequestPattern> patterns, Boolean handleAuthRequests)
patterns - If specified, only requests matching any of these patterns will produce
fetchRequested event and will be paused until clients response. If not set, all requests
will be affected.handleAuthRequests - If true, authRequired events will be issued and requests will be
paused expecting a call to continueWithAuth.void failRequest(String requestId, ErrorReason errorReason)
requestId - An id the client received in requestPaused event.errorReason - Causes the request to fail with the given reason.void fulfillRequest(String requestId, Integer responseCode, List<HeaderEntry> responseHeaders)
requestId - An id the client received in requestPaused event.responseCode - An HTTP response code.responseHeaders - Response headers.void fulfillRequest(String requestId, Integer responseCode, List<HeaderEntry> responseHeaders, String body, String responsePhrase)
requestId - An id the client received in requestPaused event.responseCode - An HTTP response code.responseHeaders - Response headers.body - A response body.responsePhrase - A textual representation of responseCode. If absent, a standard phrase
mathcing responseCode is used.void continueRequest(String requestId)
requestId - An id the client received in requestPaused event.void continueRequest(String requestId, String url, String method, String postData, List<HeaderEntry> headers)
requestId - An id the client received in requestPaused event.url - If set, the request url will be modified in a way that's not observable by page.method - If set, the request method is overridden.postData - If set, overrides the post data in the request.headers - If set, overrides the request headrts.void continueWithAuth(String requestId, AuthChallengeResponse authChallengeResponse)
requestId - An id the client received in authRequired event.authChallengeResponse - Response to with an authChallenge.ResponseBody getResponseBody(String requestId)
requestId - Identifier for the intercepted request to get body for.String takeResponseBodyAsStream(String requestId)
requestId - EventListener onRequestPaused(EventHandler<RequestPaused> eventListener)
EventListener onAuthRequired(EventHandler<AuthRequired> eventListener)
Copyright © 2020. All rights reserved.