How to Send JSON Body in Postman: Step-by-Step Guide
To send a JSON body in Postman, select
POST or another method that supports a body, go to the Body tab, choose raw, and select JSON from the dropdown. Then, enter your JSON data in the text area and send the request.Syntax
In Postman, sending a JSON body involves setting the HTTP method, selecting the body type, and specifying the JSON content.
- HTTP Method: Usually
POST,PUT, orPATCHfor sending data. - Headers: Set
Content-Typetoapplication/jsonto tell the server you are sending JSON. - Body: Choose
rawand selectJSONformat, then enter your JSON data.
http
POST /api/example HTTP/1.1 Host: example.com Content-Type: application/json { "key": "value", "number": 123 }
Example
This example shows how to send a JSON body with a POST request in Postman to create a new user with a name and email.
json
{
"name": "Alice",
"email": "alice@example.com"
}Output
HTTP/1.1 201 Created
{
"id": "123",
"name": "Alice",
"email": "alice@example.com"
}
Common Pitfalls
Common mistakes when sending JSON in Postman include:
- Not setting
Content-Typeheader toapplication/json, causing the server to reject the data. - Entering invalid JSON syntax, such as missing quotes or commas.
- Choosing the wrong body type (e.g.,
form-datainstead ofraw).
Always validate your JSON before sending.
json
Wrong way:
{
"name": "Alice",
"email": "alice@example.com"
}
Right way:
{
"name": "Alice",
"email": "alice@example.com"
}Quick Reference
| Step | Action |
|---|---|
| 1 | Select HTTP method (POST, PUT, PATCH) |
| 2 | Go to Body tab and select raw |
| 3 | Choose JSON from the dropdown menu |
| 4 | Enter valid JSON data in the text area |
| 5 | Ensure Content-Type header is application/json |
| 6 | Click Send to execute the request |
Key Takeaways
Always select raw body and JSON format to send JSON data in Postman.
Set the Content-Type header to application/json to inform the server.
Validate your JSON syntax to avoid errors.
Use POST, PUT, or PATCH methods when sending JSON bodies.
Check the server response to confirm your JSON was received correctly.