mirror of
https://github.com/hanzoai/msw.git
synced 2026-09-24 17:00:34 +00:00
Co-authored-by: Frederik Rabøl <[email protected]> Co-authored-by: Christoph Fricke <[email protected]> Co-authored-by: Piotr <[email protected]> Co-authored-by: Kristján Oddsson <[email protected]> Co-authored-by: thepassle <[email protected]> Co-authored-by: Kevin Østerkilde <[email protected]> Co-authored-by: Laryssa Rocha <[email protected]> Co-authored-by: Matthew Costabile <[email protected]>
24 lines
490 B
HTML
24 lines
490 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<body>
|
|
<script>
|
|
window.makeRequest = () => {
|
|
const data = new FormData()
|
|
data.set('name', 'Alice')
|
|
data.set('file', new File(['hello world'], 'file.txt'))
|
|
data.set(
|
|
'ids',
|
|
new Blob([JSON.stringify([1, 2, 3])], {
|
|
type: 'application/json',
|
|
}),
|
|
)
|
|
|
|
fetch('/formData', {
|
|
method: 'POST',
|
|
body: data,
|
|
})
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|