Postman Request Body Types

When you send a POST, PUT, or PATCH request, you include data in the request body. Postman supports several body formats. Choosing the right one depends on what the API expects. This topic explains each format with a practical example.

Where to Find the Body Tab

Click the Body tab below the URL bar in any POST, PUT, or PATCH request. Postman shows you several radio buttons, each representing a different body format.

Body Format Options in Postman

Body Tab Options:
  ○ none
  ○ form-data
  ○ x-www-form-urlencoded
  ● raw             ← most common for JSON APIs
  ○ binary
  ○ GraphQL

None

Select none when you do not need to send any body data. Use this for GET and DELETE requests where the URL already identifies what you need.

Raw (JSON)

The raw option lets you type any text directly. When you choose JSON from the format dropdown next to it, Postman sets the Content-Type header to application/json automatically.

When to Use Raw JSON

Use raw JSON when the API expects a structured JSON object in the body. This is the format most REST APIs use today.

Example

{
  "name": "Alice",
  "email": "alice@example.com",
  "role": "admin"
}

This creates a new user record with three fields. The server reads this JSON and saves the data.

Other Raw Formats

Besides JSON, the raw dropdown also includes Text, JavaScript, HTML, and XML. Use these when the API specifically asks for one of those formats.

Form-Data

The form-data option sends data just like an HTML form submission. Each field appears as a separate key-value row. Crucially, form-data supports file uploads alongside text values.

When to Use Form-Data

  • Uploading a file (like a profile photo or a document)
  • Sending a mix of text and file data in one request

How to Send a File with Form-Data

  1. Select the form-data radio button
  2. Add a key row, for example: Key = profile_picture
  3. Hover over the Key column — a Text dropdown appears
  4. Change it from Text to File
  5. Click Select Files in the Value column and pick a file from your computer
  6. Click Send

The server receives the file attached to the request.

x-www-form-urlencoded

This format also sends key-value pairs but encodes them as a URL string in the body. It does not support file uploads. Most traditional web forms used this format before JSON APIs became common.

Diagram – Form-Data vs URL-Encoded

form-data body (multipart):
  --boundary
  Content-Disposition: form-data; name="username"
  Alice
  --boundary
  Content-Disposition: form-data; name="file"; filename="photo.jpg"
  [binary file data here]

x-www-form-urlencoded body:
  username=Alice&role=admin&age=30

URL-encoded data travels as a simple text string. Form-data uses a multi-part structure to carry both text and binary data.

Binary

Use binary to send a raw file directly as the entire body — no key-value wrapping. This is common when an API expects a file uploaded directly with no additional fields.

Example Use Case

Some image processing APIs accept a raw image file as the request body. You select binary, click Select File, choose your image, and send. The API receives the raw image bytes directly.

GraphQL

The GraphQL option provides a built-in editor for GraphQL queries. It displays two text areas: one for the query itself and one for variables. Postman auto-formats and syntax-highlights your GraphQL code.

Example GraphQL Query in Postman

Query:
{
  user(id: "1") {
    name
    email
    posts {
      title
    }
  }
}

Variables:
{}

Choosing the Right Body Format

SituationUse This Format
Sending JSON data to a REST APIraw → JSON
Uploading a file with text fieldsform-data
Old-style form submission, no filesx-www-form-urlencoded
Uploading a raw file with no other fieldsbinary
Sending a GraphQL queryGraphQL
GET or DELETE requestnone

Formatting JSON in Postman

After pasting JSON into the raw body editor, press Ctrl+B (Windows/Linux) or Cmd+B (macOS) to auto-format and beautify the JSON. Postman will also highlight syntax errors with a red underline if your JSON is not valid.

Summary

Postman supports six body formats. Raw JSON is the most widely used with modern REST APIs. Form-data handles file uploads. URL-encoded works with older HTML-style forms. Binary sends a raw file as the whole body. GraphQL has its own built-in editor. Choose the format that matches what the API documentation specifies for each request.

Leave a Comment

Your email address will not be published. Required fields are marked *