Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Request Body
Cyber Security

Request Body

← Back to Glossary
By NHI Mgmt Group Updated October 31, 2026 Domain: Cyber Security

A request body is the payload sent with an HTTP request, usually used when the client needs to submit structured data to the server. In Next.js route handlers, it can be read with request.json() and is commonly used for create, update, or delete operations that carry fields like name or id.

What a request body contains

A request body is the part of an HTTP request that carries the data the client wants the server to process. It is distinct from the URL path and query string, and it is typically used when the request needs structured input such as JSON, form data, or nested objects that cannot be expressed cleanly in the route itself.

Because the body can hold arbitrary application data, its meaning depends on the endpoint contract. One API may expect a small update payload, while another may accept a large object graph, file metadata, or multiple optional fields. That flexibility is useful, but it also means the server must validate format, size, and semantics before acting on the content.

How request bodies are used in HTTP and Next.js

In standard HTTP, a request body usually appears with methods such as POST, PUT, PATCH, and DELETE, although method semantics depend on the API design. The body is the primary channel for creating, replacing, or modifying server-side resources when the required input is more than a simple identifier.

In Next.js route handlers, request.json() is a common way to parse a JSON body into a usable object. That makes the body the handoff point between transport and application logic: the framework reads the payload, and the handler decides whether the data is complete, trustworthy, and valid for the operation being requested.

Why request bodies matter for API design

Request bodies shape how an API expresses intent. They let a client submit structured data in one place instead of spreading it across query parameters or path segments, which is especially important for operations that involve multiple fields or nested relationships. They also help keep URLs stable while allowing the payload to evolve with the application contract.

Good request-body design is closely tied to schema clarity. If the server expects fields such as name, id, or nested settings, the body definition should make those requirements explicit so clients know what to send and the server can reject incomplete or malformed submissions consistently.

For API readers, it helps to think of the body as the request's content layer: the route identifies the target, while the body describes the change, object, or parameters being submitted. That separation is one reason request bodies are central to modern web APIs and serverless handlers.

Validation, parsing, and security implications

Request bodies need more scrutiny than many developers assume, because the payload is untrusted input. The server should not assume the body is JSON just because the client says so, and it should not assume that fields are present, correctly typed, or safe to use in downstream logic.

Parsing is only the first step. After decoding, the application still needs to check required fields, expected formats, maximum size, and whether the submitted values are consistent with the current user session or operation. Bodies can also carry sensitive data, so logging and error handling should avoid exposing full payloads unnecessarily.

In practice, request-body handling is where API trust boundaries become visible. A handler that accepts body content without strict validation can be vulnerable to broken authorization, mass assignment, oversized payloads, or unexpected server-side behaviour. That is why body parsing and validation belong together, not as separate concerns.

Risk and Threat Considerations

Request bodies are a common place for abuse because they carry the application data an endpoint will act on. If the server trusts the payload too early, attackers can submit unexpected fields, malformed content, or oversized bodies to influence logic, exhaust resources, or reach code paths the developer did not intend.

Failure mechanism: Weak body validation, permissive deserialization, or missing authorization checks can let an attacker change data they should not control, trigger parsing errors, or create denial-of-service conditions through large or complex payloads.

Impact: The result can be broken business logic, corrupted records, hidden privilege changes, or service instability, especially when the request body is used to drive create, update, or delete operations.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV2 — Validation and Business LogicRequest bodies carry untrusted input that must be validated before business logic runs.
V8 — AuthorizationBodies often carry identifiers and action parameters that must be checked against caller rights.
V16 — Security Logging and Error HandlingBody parsing failures and sensitive payloads require careful logging and controlled error handling.
Recommendation — Validate request-body fields, types, and business rules before processing state-changing actions. Enforce authorization checks on body-driven changes before updating or deleting resources. Log request-body failures without exposing sensitive payload contents or internal parser details.
NIST SP 800-53 Rev 5SI-10 — Information Input ValidationRequest bodies are a primary untrusted input channel that needs systematic validation.
AC-3 — Access EnforcementState-changing body content must be checked against access rules before execution.
Recommendation — Apply input-validation controls to all request-body data before it reaches application logic. Enforce access rules on request-body actions and fields before making state changes.

Practitioner Guidance

Why practitioners should care: The request body is often the shortest path from untrusted client input to state-changing server logic. That makes it a high-value control point for schema validation, authorization checks, and safe parsing.

What to watch for: Treat every handler that consumes a body as a trust boundary. Make sure the endpoint rejects unexpected fields, limits body size, and validates that the parsed data matches both the API contract and the caller's permitted action.

Practitioner takeaway: A request body is not just payload transport, it is the point where input becomes application state, so validation and authorization need to happen before the data is used.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org