Skip to content

Commit b950549

Browse files
committed
docs: multipart form data doc
1 parent 49fbea1 commit b950549

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

docs/collections.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,24 @@ paths:
114114
username: admin
115115
password: secret
116116
```
117+
118+
## Multipart Form Data
119+
120+
To send `multipart/form-data` (typically for file upload), define the `body` fields and file paths:
121+
122+
```yaml
123+
paths:
124+
- endpoint: /upload
125+
name: upload
126+
method: POST
127+
headers:
128+
Content-Type: multipart/form-data
129+
body:
130+
title: lorem
131+
file: "./path/file.png"
132+
```
133+
134+
- `headers.Content-Type`: Should be set to `multipart/form-data` to indicate file upload.
135+
- `body`: Key-value pairs to be sent. For file fields, use a relative or absolute path to the file.
136+
137+
> Note: Files are automatically detected if the value is a valid path to a local file.

0 commit comments

Comments
 (0)