code hindi Information technologyCareer blogs Courses info Digital Marketing About

HTTP payload kya hota hai? Explained in simple Hindi

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:

  • 1. Text:
    - Plain text content (e.g., `Content-Type: text/plain`).
  • 2. HTML:
    - HyperText Markup Language content (e.g., `Content-Type: text/html`).
  • 3. JSON:
    - JavaScript Object Notation content (e.g., `Content-Type: application/json`).
  • 4. XML:
    - Extensible Markup Language content (e.g., `Content-Type: application/xml`).
  • 5. Form Data:
    - Form data in key-value pair format (e.g., `Content-Type: application/x-www-form-urlencoded`).
  • 6. Binary Data:
    - Non-text binary data (e.g., `Content-Type: application/octet-stream`).

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:

http
HTTP/1.1 200 OK
Content-Type: text/html

  
  
      Example 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.

Server kya hota hai

Integrated Development Environment (IDE) kya hai