Skip to main content

cdp_driver/methods/
fetch.rs

1// @generated by `just generate-methods` from protocol/*.json.
2// Do not edit by hand; edit xtask/ and regenerate.
3
4//! A domain for letting clients substitute browser's network layer with
5//! client code.
6//!
7//! Method names for the `Fetch` domain, for use with
8//! [`CdpClient::call`](crate::CdpClient::call).
9
10/// Disables the fetch domain.
11pub const DISABLE: &str = "Fetch.disable";
12
13/// Enables issuing of requestPaused events. A request will be paused until
14/// client calls one of failRequest, fulfillRequest or
15/// continueRequest/continueWithAuth.
16///
17/// Parameters:
18/// - `patterns`: array (optional)
19/// - `handleAuthRequests`: boolean (optional)
20pub const ENABLE: &str = "Fetch.enable";
21
22/// Causes the request to fail with specified reason.
23///
24/// Parameters:
25/// - `requestId`: RequestId
26/// - `errorReason`: Network.ErrorReason
27pub const FAIL_REQUEST: &str = "Fetch.failRequest";
28
29/// Provides response to the request.
30///
31/// Parameters:
32/// - `requestId`: RequestId
33/// - `responseCode`: integer
34/// - `responseHeaders`: array (optional)
35/// - `binaryResponseHeaders`: string (optional)
36/// - `body`: string (optional)
37/// - `responsePhrase`: string (optional)
38pub const FULFILL_REQUEST: &str = "Fetch.fulfillRequest";
39
40/// Continues the request, optionally modifying some of its parameters.
41///
42/// Parameters:
43/// - `requestId`: RequestId
44/// - `url`: string (optional)
45/// - `method`: string (optional)
46/// - `postData`: string (optional)
47/// - `headers`: array (optional)
48/// - `interceptResponse`: boolean (optional)
49pub const CONTINUE_REQUEST: &str = "Fetch.continueRequest";
50
51/// Continues a request supplying authChallengeResponse following authRequired
52/// event.
53///
54/// Parameters:
55/// - `requestId`: RequestId
56/// - `authChallengeResponse`: AuthChallengeResponse
57pub const CONTINUE_WITH_AUTH: &str = "Fetch.continueWithAuth";
58
59/// Continues loading of the paused response, optionally modifying the
60/// response headers. If either responseCode or headers are modified, all of
61/// them must be present.
62///
63/// Experimental: may change without notice.
64///
65/// Parameters:
66/// - `requestId`: RequestId
67/// - `responseCode`: integer (optional)
68/// - `responsePhrase`: string (optional)
69/// - `responseHeaders`: array (optional)
70/// - `binaryResponseHeaders`: string (optional)
71pub const CONTINUE_RESPONSE: &str = "Fetch.continueResponse";
72
73/// Causes the body of the response to be received from the server and
74/// returned as a single string. May only be issued for a request that is
75/// paused in the Response stage and is mutually exclusive with
76/// takeResponseBodyForInterceptionAsStream. Calling other methods that affect
77/// the request or disabling fetch domain before body is received results in
78/// an undefined behavior. Note that the response body is not available for
79/// redirects. Requests paused in the _redirect received_ state may be
80/// differentiated by `responseCode` and presence of `location` response
81/// header, see comments to `requestPaused` for details.
82///
83/// Parameters:
84/// - `requestId`: RequestId
85///
86/// Returns: `body`, `base64Encoded`
87pub const GET_RESPONSE_BODY: &str = "Fetch.getResponseBody";
88
89/// Returns a handle to the stream representing the response body. The request
90/// must be paused in the HeadersReceived stage. Note that after this command
91/// the request can't be continued as is -- client either needs to cancel it
92/// or to provide the response body. The stream only supports sequential read,
93/// IO.read will fail if the position is specified. This method is mutually
94/// exclusive with getResponseBody. Calling other methods that affect the
95/// request or disabling fetch domain before body is received results in an
96/// undefined behavior.
97///
98/// Parameters:
99/// - `requestId`: RequestId
100///
101/// Returns: `stream`
102pub const TAKE_RESPONSE_BODY_AS_STREAM: &str = "Fetch.takeResponseBodyAsStream";