HTTP payload, ya body, ek HTTP request ya response ke hisse ka data hota hai jo headers ke baad aata hai. Payload mein actual content hota hai, jise client server ko send karta hai (request mein) ya server client ko send karta hai (response mein).
Payload ke format content type ke hisab se hota hai. Kuch common content types include:
Example of an HTTP request with payload:
http
POST /example/resource HTTP/1.1
Content-Type: application/json
{"key": "value"}
In this example, the request is a POST request targeting the `/example/resource` URI with a JSON payload. The payload is the data sent to the server for processing.
Similarly, an example of an HTTP response with payload:
httpExample Page Hello, World!
In this example, the response includes an HTML payload with the content of an example web page.
The payload is crucial for transmitting the actual data between the client and the server, allowing them to exchange information as part of the HTTP communication.