What is payload?

35

I have always seen in some frameworks that work with REST or with sending data in JSON format in a request the use of the expression payload .

  • What does this name mean in HTTP requests?

  • What specifically is a payload ? Is a body of a request in JSON format?

An example of the term being used by Google Chrome:

Example 1:

Example2:

    
asked by anonymous 07.03.2017 / 17:48

3 answers

31

It would be the data that really matters without metadata, without the transmission header or other ancillary information used only as infrastructure to convey what matters. So it is the body of information, it is what is useful of everything that is being transmitted.

The literal translation "payload" could be called "worthwhile content."

The meaning may be different in other contexts, even in computing.

Sample TCP packet (I did not find a good HTTP, but the idea is similar). The data is payload :

Inanotherquestionthereisadiagramshowingthevariouslayersofcommunicationandallhaveheadersthatareaddedineachlayerandthe"data" part, that is the payload . If payload is too small, the overhead of the headers of all layers becomes a burden. You may have some control over the size of the payload in the high layer, but in the lower the control gets smaller, very large payloads tend to be sliced before being transmitted.

Payload has no text or binary format. Being JSON is just circumstantial. In HTTP it is even a text by protocol imposition, but it can be THML, CSS, JS, raw text, binary encoded in base64 , etc.

    
07.03.2017 / 17:53
12

In general terms, payload ("load") is the content sent by a means of transport, or carrier . Some examples:

  • The content HTML is the payload sent via protocol HTTP ;
  • The content JSON is the payload sent via protocol HTTP from the endpoint REST *;
  • The content XML is the payload sent via protocol HTTP from the endpoint SOAP *.

In some terminologies, the carrier is also called envelope.

* For example purposes only. REST and SOAP endpoints can generate payloads in other formats.

    
07.03.2017 / 20:50
0

Payload in terms of protocol is nothing less than its content. For example the Payload of an IP protocol can be TCP. That is, roughly it is what represents the data to be transported by protocol. It's the same with HTTP and Json. And the payload presented within this context is what will be carried in Json's request.

    
07.03.2017 / 23:06