Skip to content

Commit 9e0cfcb

Browse files
authored
docs: correct example in FormData request (#4226)
1 parent 95fd9d3 commit 9e0cfcb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

docs/examples/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,14 @@ async function formDataBlobRequest () {
8484
formData.append('field', 42)
8585
formData.set('file', await openAsBlob('./index.mjs'))
8686

87-
const response = await request('http://127.0.0.1:3000', {
87+
const {
88+
statusCode,
89+
headers,
90+
body
91+
} = await request('http://127.0.0.1:3000', {
8892
method: 'POST',
8993
body: formData
9094
})
91-
console.log(await response.body.text())
9295

9396
const data = await body.text()
9497
console.log('response received', statusCode)
@@ -126,7 +129,7 @@ async function deleteRequest (port = 3001) {
126129
}
127130
```
128131

129-
## Production configuration
132+
## Production configuration
130133

131134
### Using interceptors to add response caching, DNS lookup caching and connection retries
132135

0 commit comments

Comments
 (0)