payload

The actual data a message carries, as opposed to the headers and framing around it.

In more detail

In an HTTP message the payload is the body after the headers and a blank line: a JSON representation, a problem document or form data. Content-Type says what format it is in and Content-Length how many bytes it has, and some responses, such as 204, 304 and every answer to HEAD, have none. In a JSON Web Token the payload is the middle part holding the claims, and in a webhook or socket message it is the event data.

Example

In the browser: A CustomEvent's payload goes in detail, a postMessage payload is structured-cloned, and a Background Sync queue stores request payloads until they can be sent.

Related terms

Taught in

References

Certification courses