0
0
PostmanHow-ToBeginner · 3 min read

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-data header 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-Type to multipart/form-data in Postman headers; Postman handles the boundary automatically.
  • Wrong body type: Using raw or x-www-form-urlencoded instead of form-data will not send multipart data correctly.
  • File field type: Ensure file fields are set to type File in 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

StepActionNotes
1Select POST method and enter URLBasic setup for request
2Go to Body tabWhere to add form data
3Choose form-dataEnables multipart form data
4Add key-value pairsUse 'File' type for files
5Send requestPostman 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.