formData()
方法在
Body
mixin takes a
响应
stream and reads it to completion. It returns a promise that resolves with a
FormData
对象。
注意
: This is mainly relevant to
service workers
. If a user submits a form and a service worker intercepts the request, you could for example call
formData()
on it to obtain a key-value map, modify some fields, then send the form onwards to the server (or use it locally).
response.formData()
.then(function(formdata) {
// do something with your formdata
});
None.
A
Promise
that resolves with a
FormData
对象。
TBD.
| 规范 | 状态 | 注释 |
|---|---|---|
|
Fetch
The definition of 'formData()' in that specification. |
实时标准 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
formData
|
Chrome 60 | Edge ≤79 |
Firefox
39
|
IE No | Opera 47 | Safari 10 | WebView Android 60 | Chrome Android 60 | Firefox Android No | Opera Android 44 | Safari iOS Yes | Samsung Internet Android 8.0 |
完整支持
不支持
实验。期望将来行为有所改变。
用户必须明确启用此特征。