Payload means the actual data being carried inside a message/request/response.
The word comes from transportation:
Truck
└── Payload = the actual goods being transportedIn software:
HTTP Request
├── Headers (metadata)
└── Payload (actual data)Example: HTTP request
Imagine creating a user:
POST /api/usersHeaders:
Authorization: Bearer abc123
Content-Type: application/jsonPayload (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/jsonMeaning:
“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 OKResponse 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
└── SignatureExample 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