How to Send Multipart Form Data in Postman: Step-by-Step Guide
To send
multipart/form-data in Postman, select the Body tab, choose form-data, then add key-value pairs where values can be text or files. Postman automatically sets the Content-Type header to multipart/form-data with the correct boundary.Syntax
In Postman, sending multipart form data involves these steps:
- Select the POST method and enter the request URL.
- Go to the Body tab.
- Choose form-data as the body type.
- Add key-value pairs where keys are field names and values can be text or files.
- Postman sets the
Content-Type: multipart/form-dataheader automatically with the correct boundary.
http
POST /upload HTTP/1.1 Host: example.com Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="field1" value1 ------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file1"; filename="example.txt" Content-Type: text/plain (file content here) ------WebKitFormBoundary7MA4YWxkTrZu0gW--
Example
This example shows how to send a text field and a file using Postman’s form-data option.
plaintext
POST https://example.com/api/upload Body tab: - Select 'form-data' - Add key: 'username', value: 'tester' - Add key: 'profilePic', type: 'File', select a file from your computer Headers: - Content-Type is set automatically to multipart/form-data with boundary
Output
HTTP/1.1 200 OK
{
"status": "success",
"message": "File and data received"
}
Common Pitfalls
- Manually setting Content-Type header: Do not manually set
Content-Typetomultipart/form-datain Postman headers; Postman handles the boundary automatically. - Wrong body type: Using
raworx-www-form-urlencodedinstead ofform-datawill not send multipart data correctly. - File field type: Ensure file fields are set to type
Filein Postman, not text.
plaintext
Wrong way: Headers: Content-Type: multipart/form-data Body tab: - raw JSON or x-www-form-urlencoded Right way: Body tab: - form-data - Add file field with type 'File' - Let Postman set Content-Type automatically
Quick Reference
| Step | Action | Notes |
|---|---|---|
| 1 | Select POST method and enter URL | Basic setup for request |
| 2 | Go to Body tab | Where to add form data |
| 3 | Choose form-data | Enables multipart form data |
| 4 | Add key-value pairs | Use 'File' type for files |
| 5 | Send request | Postman sets Content-Type automatically |
Key Takeaways
Use the Body tab and select form-data to send multipart form data in Postman.
Add text fields as key-value pairs and files by setting the value type to File.
Do not manually set the Content-Type header; Postman handles it with the correct boundary.
Avoid using raw or x-www-form-urlencoded body types for multipart data.
Check that file inputs are correctly marked as File type to upload files properly.