这篇翻译不完整。请帮忙从英语翻译这篇文章。
Body
对象中的formData()
方法将 Response
对象中的所承载的数据流读取并封装成为一个对象,该方法将返回一个 Promise
对象,该对象将产生一个FormData
对象。
注意: 该方法主要与 service workers 有关. 如果客户端提交的一个表单请求被Service Worker 所截取,您可以像下述的样例一样,调用 formData()
方法来获取一个key-value 字典, 对该字典可以进行修饰, 然后将修饰后的表填提交给远端服务器 (或在本地应用)。
语法
response.formData() .then(function(formdata) { // do something with your formdata });
参数
无。
返回值
样例
待定.
详述
Specification | Status | Comment |
---|---|---|
Fetch formData() |
Living Standard |
Browser compatibility
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support |
60 |
39 (39) [1] | 未实现 |
47 |
未实现 |
Feature | Android Webview | Chrome for Android | Firefox Mobile (Gecko) | Firefox OS (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|
Basic support |
60 |
60 |
未实现 | 未实现 | 未实现 |
47 |
未实现 |
[1] Behind a preference starting with version 34.