Skip to content
BENIBIX Learn

Request Body

Infrastructure🌐 NetworkingRequests and Responses

Also known as Body, Payload, HTTP Body

The data sent inside a web request, after the headers. POST and PUT use one.

Think of it like

Think of it like a card in an envelope. The note is inside, not on the front.

Example

Lucy uploads a photo of 2 MB. The photo travels in the request body, and the headers say its type is image/jpeg.

Why it matters

Anything too big or too private for the address goes in the body.

Definition

The request body is the data sent after the headers in a web request. It carries what you are sending, like a new user, a form or a file. POST, PUT and PATCH requests usually have one; GET and DELETE usually do not. A header called Content-Type says what format the body is in, such as JSON. A blank line separates the headers from the body.

Example code

json
{
  "name": "Lucy",
  "email": "lucy@example.com"
}
A JSON body for creating a user.

Common mistake

Sending JSON without a Content-Type header that says so. Many servers then read the body as empty.

Key takeaways

  1. 1
    After the headers. Past a blank line.
  2. 2
    The data itself. A record, a form, a file.
  3. 3
    Typed by a header. Content-Type says the format.

Compare

Learn it properly