You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/api/class-request.md
+34-10Lines changed: 34 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,32 @@ request is issued to a redirected url.
23
23
24
24
An object with all the request HTTP headers associated with this request. The header names are lower-cased.
25
25
26
+
## async method: Request.body
27
+
* since: v1.58
28
+
- returns: <[null]|[string]>
29
+
30
+
The request body, if present.
31
+
32
+
## async method: Request.bodyBuffer
33
+
* since: v1.58
34
+
- returns: <[null]|[Buffer]>
35
+
36
+
The request body in a binary form. Returns null if the request has no body.
37
+
38
+
## async method: Request.bodyJSON
39
+
* since: v1.58
40
+
* langs: js, python
41
+
- returns: <[null]|[Serializable]>
42
+
43
+
Returns the request body as a parsed JSON object. If the request `Content-Type` is `application/x-www-form-urlencoded`, this method returns a key/value object parsed from the form data. Otherwise, it parses the body as JSON.
44
+
45
+
## async method: Request.bodyJSON
46
+
* since: v1.58
47
+
* langs: csharp
48
+
- returns: <[null]|[JsonElement]>
49
+
50
+
Returns the request body as a parsed JSON object. If the request `Content-Type` is `application/x-www-form-urlencoded`, this method returns a key/value object parsed from the form data. Otherwise, it parses the body as JSON.
51
+
26
52
## method: Request.failure
27
53
* since: v1.8
28
54
- returns: <[null]|[string]>
@@ -149,35 +175,33 @@ Request's method (GET, POST, etc.)
149
175
150
176
## method: Request.postData
151
177
* since: v1.8
178
+
* discouraged: Use [`method: Request.body`] instead.
152
179
- returns: <[null]|[string]>
153
180
154
-
Request's post body, if any.
181
+
The request body, if present.
155
182
156
183
## method: Request.postDataBuffer
157
184
* since: v1.8
185
+
* discouraged: Use [`method: Request.bodyBuffer`] instead.
158
186
- returns: <[null]|[Buffer]>
159
187
160
-
Request's post body in a binary form, if any.
188
+
The request body in a binary form. Returns null if the request has no body.
161
189
162
190
## method: Request.postDataJSON
163
191
* since: v1.8
164
192
* langs: js, python
193
+
* discouraged: Use [`method: Request.bodyJSON`] instead.
165
194
- returns: <[null]|[Serializable]>
166
195
167
-
Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.
168
-
169
-
When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.
170
-
Otherwise it will be parsed as JSON.
196
+
Returns the request body as a parsed JSON object. If the request `Content-Type` is `application/x-www-form-urlencoded`, this method returns a key/value object parsed from the form data. Otherwise, it parses the body as JSON.
171
197
172
198
## method: Request.postDataJSON
173
199
* since: v1.12
174
200
* langs: csharp
201
+
* discouraged: Use [`method: Request.bodyJSON`] instead.
175
202
- returns: <[null]|[JsonElement]>
176
203
177
-
Returns parsed request's body for `form-urlencoded` and JSON as a fallback if any.
178
-
179
-
When the response is `application/x-www-form-urlencoded` then a key/value object of the values will be returned.
180
-
Otherwise it will be parsed as JSON.
204
+
Returns the request body as a parsed JSON object. If the request `Content-Type` is `application/x-www-form-urlencoded`, this method returns a key/value object parsed from the form data. Otherwise, it parses the body as JSON.
maxEncodedDataSize: 20_000_000,// same default as in CDP: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_network_agent.cc;l=134;drc=4128411589187a396829a827f59a655bed876aa7
0 commit comments