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
+10-34Lines changed: 10 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,32 +23,6 @@ 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.57
28
-
- returns: <[null]|[string]>
29
-
30
-
The request body, if present.
31
-
32
-
## async method: Request.bodyBuffer
33
-
* since: v1.57
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.57
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.57
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
-
52
26
## method: Request.failure
53
27
* since: v1.8
54
28
- returns: <[null]|[string]>
@@ -175,33 +149,35 @@ Request's method (GET, POST, etc.)
175
149
176
150
## method: Request.postData
177
151
* since: v1.8
178
-
* discouraged: Use [`method: Request.body`] instead.
179
152
- returns: <[null]|[string]>
180
153
181
-
The request body, if present.
154
+
Request's post body, if any.
182
155
183
156
## method: Request.postDataBuffer
184
157
* since: v1.8
185
-
* discouraged: Use [`method: Request.bodyBuffer`] instead.
186
158
- returns: <[null]|[Buffer]>
187
159
188
-
The request body in a binary form. Returns null if the request has no body.
160
+
Request's post body in a binary form, if any.
189
161
190
162
## method: Request.postDataJSON
191
163
* since: v1.8
192
164
* langs: js, python
193
-
* discouraged: Use [`method: Request.bodyJSON`] instead.
194
165
- returns: <[null]|[Serializable]>
195
166
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.
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.
197
171
198
172
## method: Request.postDataJSON
199
173
* since: v1.12
200
174
* langs: csharp
201
-
* discouraged: Use [`method: Request.bodyJSON`] instead.
202
175
- returns: <[null]|[JsonElement]>
203
176
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.
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.
0 commit comments