Skip to content

Commit 2dde96a

Browse files
authored
🔧 fix: clarification of content-type header in relation to body (#256)
1 parent be810c4 commit 2dde96a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎docs/validation/schema-type.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,12 @@ Validate an incoming [HTTP Message](https://developer.mozilla.org/en-US/docs/Web
8080

8181
These messages are additional messages for the webserver to process.
8282

83-
The body is provided as same as `body` in `fetch` API.
83+
The body is provided as same as `body` in `fetch` API. The content type should be set accordingly to the defined body.
8484

8585
```typescript
8686
fetch('https://elysiajs.com', {
8787
method: 'POST',
88+
headers: { 'Content-Type': 'application/json' },
8889
body: JSON.stringify({
8990
name: 'Elysia'
9091
})

0 commit comments

Comments
 (0)