Payload
ELI5 — The Vibe Check
Payload is the actual data carried in a request or response — the valuable cargo. Like a delivery truck: the truck, wheels, and label are overhead, but the package inside is the payload. In an HTTP POST request, the payload is the JSON (or form data) you're sending.
Real Talk
In networking, the payload is the data portion of a packet or message, as distinguished from the protocol overhead (headers, metadata). In HTTP, it refers to the request or response body. In APIs, 'payload' and 'body' are often used interchangeably.
Show Me The Code
// Request with payload (body)
fetch('/api/users', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ // This JSON is the payload
name: 'Bob',
email: 'bob@example.com'
})
});
When You'll Hear This
"Log the request payload to debug the API." / "The payload is too large — the server rejected it."
Related Terms
Content-Type
Content-Type is a header that tells the receiver what format the data is in. 'I'm sending you JSON.' 'I'm sending you a PNG image.' 'I'm sending you HTML.
HTTP (HyperText Transfer Protocol)
HTTP is the language your browser uses to ask websites for stuff. You type a URL, your browser shouts 'hey, give me that page!
Packet
A packet is a small chunk of data with an envelope around it.
Request
A request is what your browser (or app) sends to a server when it wants something. 'Give me the homepage.' 'Give me that image.
Response
A response is what the server sends back after receiving a request.