1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
// @generated by scripts/generate-puppeteer-bindings.mjs from
// rust/protocol/puppeteer/api.json. Do not edit by hand.
#![allow(clippy::all, missing_docs, unused_imports, non_snake_case)]
use serde_json::Value;
use super::*;
use crate::puppeteer::bridge::{binary, remote_type, BridgeError, JsFunction, Remote};
remote_type!(
/// Puppeteer's `HTTPResponse` (puppeteer-core 25.10.0), a remote object
/// served by `browser-commander serve --stdio`.
HTTPResponse
);
impl HTTPResponse {
/// `HTTPResponse.remoteAddress`
///
/// ```text
/// remoteAddress(): RemoteAddress
/// ```
pub async fn remote_address(&self) -> Result<Value, BridgeError> {
self.remote.call("remoteAddress", vec![]).await
}
/// `HTTPResponse.url`
///
/// ```text
/// url(): string
/// ```
pub async fn url(&self) -> Result<String, BridgeError> {
self.remote.call("url", vec![]).await
}
/// `HTTPResponse.ok`
///
/// ```text
/// ok(): boolean
/// ```
pub async fn ok(&self) -> Result<bool, BridgeError> {
self.remote.call("ok", vec![]).await
}
/// `HTTPResponse.status`
///
/// ```text
/// status(): number
/// ```
pub async fn status(&self) -> Result<f64, BridgeError> {
self.remote.call("status", vec![]).await
}
/// `HTTPResponse.statusText`
///
/// ```text
/// statusText(): string
/// ```
pub async fn status_text(&self) -> Result<String, BridgeError> {
self.remote.call("statusText", vec![]).await
}
/// `HTTPResponse.headers`
///
/// ```text
/// headers(): Record<string, string>
/// ```
pub async fn headers(&self) -> Result<Value, BridgeError> {
self.remote.call("headers", vec![]).await
}
/// `HTTPResponse.securityDetails`
///
/// ```text
/// securityDetails(): SecurityDetails | null
/// ```
pub async fn security_details(&self) -> Result<Option<SecurityDetails>, BridgeError> {
self.remote.call("securityDetails", vec![]).await
}
/// `HTTPResponse.timing`
///
/// ```text
/// timing(): Protocol.Network.ResourceTiming | null
/// ```
pub async fn timing(&self) -> Result<Option<Value>, BridgeError> {
self.remote.call("timing", vec![]).await
}
/// `HTTPResponse.content`
///
/// ```text
/// content(): Promise<Uint8Array>
/// ```
pub async fn content(&self) -> Result<Vec<u8>, BridgeError> {
self.remote.call("content", vec![]).await
}
/// `HTTPResponse.buffer`
///
/// ```text
/// buffer(): Promise<Buffer>
/// ```
pub async fn buffer(&self) -> Result<Vec<u8>, BridgeError> {
self.remote.call("buffer", vec![]).await
}
/// `HTTPResponse.text`
///
/// ```text
/// text(): Promise<string>
/// ```
pub async fn text(&self) -> Result<String, BridgeError> {
self.remote.call("text", vec![]).await
}
/// `HTTPResponse.json`
///
/// ```text
/// json(): Promise<any>
/// ```
pub async fn json(&self) -> Result<Value, BridgeError> {
self.remote.call("json", vec![]).await
}
/// `HTTPResponse.request`
///
/// ```text
/// request(): HTTPRequest
/// ```
pub async fn request(&self) -> Result<HTTPRequest, BridgeError> {
self.remote.call("request", vec![]).await
}
/// `HTTPResponse.fromCache`
///
/// ```text
/// fromCache(): boolean
/// ```
pub async fn from_cache(&self) -> Result<bool, BridgeError> {
self.remote.call("fromCache", vec![]).await
}
/// `HTTPResponse.fromServiceWorker`
///
/// ```text
/// fromServiceWorker(): boolean
/// ```
pub async fn from_service_worker(&self) -> Result<bool, BridgeError> {
self.remote.call("fromServiceWorker", vec![]).await
}
/// `HTTPResponse.frame`
///
/// ```text
/// frame(): Frame | null
/// ```
pub async fn frame(&self) -> Result<Option<Frame>, BridgeError> {
self.remote.call("frame", vec![]).await
}
}