Payload means the actual data being carried inside a message/request/response.

The word comes from transportation:

Truck
 └── Payload = the actual goods being transported

In software:

HTTP Request
 ├── Headers (metadata)
 └── Payload (actual data)

Example: HTTP request

Imagine creating a user:

POST /api/users

Headers:

Authorization: Bearer abc123
Content-Type: application/json

Payload (body):

{
  "username": "reyhan",
  "email": "reyhan@example.com",
  "password": "123456"
}

The payload is the information you actually want to send.


Payload vs Headers

Headers

Metadata about the request:

Content-Type: application/json
Authorization: Bearer token
Accept: application/json

Meaning:

“How should this request be handled?”


Payload

The content:

{
  "title": "Learn APIs",
  "status": "TODO"
}

Meaning:

“What data am I sending?”


Example: Response payload

Backend response:

200 OK

Response payload:

{
  "id": 15,
  "name": "Task 1",
  "status": "DONE"
}

The frontend receives this payload and displays it.


Payload in JWT

You may also hear about a JWT payload.

A JWT has three parts:

JWT
 |
 ├── Header
 ├── Payload
 └── Signature

Example payload:

{
  "userId": 123,
  "role": "ADMIN",
  "exp": 1750000000
}

This contains claims about the user.

Important:

  • JWT payload is encoded, not encrypted.

  • Don’t put secrets like passwords inside it.


Payload in messaging systems

Example with RabbitMQ:

Message
 ├── Metadata
 │     └── timestamp, routing key

 └── Payload
       └── "Send email to user 123"

Simple definition:

Payload = the meaningful data being transported, not the information about the transport.

A good mental shortcut:

  • Headers = information about the message

  • Payload = the message itself


Back-End My-Journey-In-Codeless