How to Send Form Data in Postman: Step-by-Step Guide
To send form data in Postman, select the
Body tab, then choose either x-www-form-urlencoded or form-data as the data type. Enter your key-value pairs for the form fields, then send the request to submit the form data.Syntax
In Postman, form data is sent in the Body section of the request. You can choose between two main types:
x-www-form-urlencoded: Encodes form fields as URL-encoded key-value pairs.form-data: Sends data as multipart/form-data, useful for files and text fields.
Each key represents a form field name, and the value is the field content.
http
POST /your-api-endpoint HTTP/1.1
Host: example.com
Content-Type: application/x-www-form-urlencoded
key1=value1&key2=value2Example
This example shows how to send form data using x-www-form-urlencoded in Postman to submit a login form with username and password.
http
POST https://example.com/api/login
Body tab:
- Select <code>x-www-form-urlencoded</code>
- Add key: <code>username</code>, value: <code>user123</code>
- Add key: <code>password</code>, value: <code>pass123</code>Output
HTTP/1.1 200 OK
{
"message": "Login successful",
"token": "abc123xyz"
}
Common Pitfalls
- Not selecting the
Bodytab or wrong data type causes the server to not receive form data. - Using
rawbody type instead ofx-www-form-urlencodedorform-datafor form submissions. - For file uploads, forgetting to use
form-dataand the file input type.
http
Wrong way: POST https://example.com/api/login Body tab: - Select <code>raw</code> - Enter JSON: {"username":"user123","password":"pass123"} Right way: POST https://example.com/api/login Body tab: - Select <code>x-www-form-urlencoded</code> - Add key: <code>username</code>, value: <code>user123</code> - Add key: <code>password</code>, value: <code>pass123</code>
Quick Reference
- Body tab: Choose
x-www-form-urlencodedfor simple form fields. - Body tab: Choose
form-datafor files or mixed data. - Key-value pairs: Enter form field names and values.
- Headers: Postman sets
Content-Typeautomatically based on body type.
Key Takeaways
Always select the Body tab and choose the correct form data type before sending.
Use x-www-form-urlencoded for simple key-value pairs and form-data for file uploads.
Enter form fields as key-value pairs to simulate form submission accurately.
Avoid using raw JSON when the API expects form data format.
Postman automatically sets the Content-Type header based on your body selection.