From b8e7efe5b8a4aa69c69328d4dfb91519bda0c1e7 Mon Sep 17 00:00:00 2001 From: inyourtime Date: Fri, 16 May 2025 11:52:59 +0700 Subject: [PATCH] docs: correct example in FormData request --- docs/examples/README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/examples/README.md b/docs/examples/README.md index 8bf3a5180c1..37ba748d58e 100644 --- a/docs/examples/README.md +++ b/docs/examples/README.md @@ -84,11 +84,14 @@ async function formDataBlobRequest () { formData.append('field', 42) formData.set('file', await openAsBlob('./index.mjs')) - const response = await request('http://127.0.0.1:3000', { + const { + statusCode, + headers, + body + } = await request('http://127.0.0.1:3000', { method: 'POST', body: formData }) - console.log(await response.body.text()) const data = await body.text() console.log('response received', statusCode) @@ -126,7 +129,7 @@ async function deleteRequest (port = 3001) { } ``` -## Production configuration +## Production configuration ### Using interceptors to add response caching, DNS lookup caching and connection retries