HTTP

Glossary Term

HTTP Payload

Learn what HTTP payload means and how message bodies carry data in requests and responses. Understand JSON, form data, and binary payloads.

1 min read beginner

TL;DR: The actual data carried in the body of an HTTP message. Contains the meaningful information being exchanged between client and server.

An HTTP payload (also called the message body) is the actual data being sent in an HTTP request or response. Think of it as the contents of a package - while headers are like the shipping label, the payload is what’s inside the box.

The payload can contain different types of data depending on what you’re sending or receiving:

  • Request payload: Data you’re sending to the server (form data, JSON, files)
  • Response payload: Data the server sends back (HTML pages, JSON data, images, videos)

Not all HTTP messages have payloads. GET requests typically don’t include a body, while POST and PUT requests usually do. The Content-Type header tells the receiver what format the payload is in.

Payloads matter because they carry the actual information being exchanged. Without payloads, you could only ask servers to do things, but couldn’t send any data or receive meaningful responses.

Examples:

  • Form submission: username=john&password=secret123 (URL-encoded form data)
  • API request: {"name": "John", "email": "john@example.com"} (JSON data)
  • File upload: Binary data representing an image or document

Related terms: HTTP Request, HTTP Response, HTTP Header

Frequently Asked Questions

What is an HTTP payload?

Payload is the data carried in the body of an HTTP message. In requests, it is data sent to the server. In responses, it is the content returned.

What is the difference between payload and body?

They are often used interchangeably. Technically, body is the raw bytes, payload is the meaningful data. After decoding transfer encoding, you have the payload.

What formats can payloads use?

Common formats include JSON, XML, HTML, form data, and binary files. The Content-Type header indicates the format so receivers know how to parse it.

Do all requests have payloads?

No, GET and HEAD typically have no payload. POST, PUT, PATCH usually include payloads. DELETE may or may not have one depending on the API.

Keep Learning