Skip to content

Commit dbd3cbf

Browse files
committed
chore: update example
1 parent d1fb088 commit dbd3cbf

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

example/basic.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,15 +94,15 @@
9494
}
9595

9696
function uploadToServer (file) {
97-
const formData = new FormData()
98-
formData.append('image', file, file.name)
99-
const url = 'http://localhost:3000/image-upload-api'
100-
console.log('calling api', url, 'with data', Array.from(formData.entries())[0])
101-
return fetch(url, {
102-
method: 'POST',
103-
body: formData
104-
}).then(res => res.json())
105-
.then(body => console.log('got server response', body))
97+
// const formData = new FormData()
98+
// formData.append('image', file, file.name)
99+
// const url = 'http://localhost:3000/image-upload-api'
100+
// console.log('calling api', url, 'with data', Array.from(formData.entries())[0])
101+
// return fetch(url, {
102+
// method: 'POST',
103+
// body: formData
104+
// }).then(res => res.json())
105+
// .then(body => console.log('got server response', body))
106106
}
107107
</script>
108108
</body>

0 commit comments

Comments
 (0)