| <!DOCTYPE html> |
| <meta charset="utf-8"> |
| <title>request-body-blob-iframe</title> |
| <body></body> |
| <script> |
| // Make a big blob to force async construction. |
| var blob = new Blob(['it\'s me the blob', |
| new Float64Array(2*1024*1024), |
| 'and more blob!']); |
| fetch('simple.html?post-with-blob-body', |
| { method: 'POST', body: blob }) |
| .then(resp => { |
| if (!resp.ok) |
| return Promise.reject('bad response: ' + resp.status); |
| return resp.text() |
| }) |
| .then(text => parent.done(text)) |
| .catch(error => { |
| var reason = error.message || error.name || error; |
| parent.done('error: ' + reason); |
| }); |
| </script> |