Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a request payload and request body?

Tags:

I am learning HTTP. I enclose a request payload in XML or JSON format in my POST requests. What I wanted to know is whether a request payload and request body mean the same thing?

like image 838
Ankur Garg Avatar asked Feb 27 '14 13:02

Ankur Garg


People also ask

What is a request payload?

The Request Payload - or to be more precise: payload body of a HTTP Request. is the data normally send by a POST or PUT Request. It's the part after the headers and the CRLF of a HTTP Request.

What is a request body?

A request body is data sent by the client to your API. A response body is the data your API sends to the client. Your API almost always has to send a response body. But clients don't necessarily need to send request bodies all the time.

What is request payload in API?

The Payload of an API Module is the body of your request and response message. It contains the data that you send to the server when you make an API request. You can send and receive Payload in different formats, for instance JSON.

What is request payload in JSON?

A request payload is data that clients send to the server in the body of an HTTP POST, PUT, or PATCH message that contains important information about the request.


1 Answers

Definition of: payload : The "actual data" in a packet or file minus all headers attached for transport and minus all descriptive meta-data. In a network packet, headers are appended to the payload for transport and then discarded at their destination.

Edit: In Http protocol, an http packet has http headers and http payload.So payload section of http packet may or may not have a body depending upon the type of request (e.g. POST vs GET). So payload and body are not the same thing.

like image 169
Satyam Avatar answered Oct 09 '22 16:10

Satyam