Request and Response

The standard Web API classes that represent an HTTP request and an HTTP response, shared by browsers, Node.js and edge platforms.

In more detail

A Request holds the method, URL, headers and body; a Response holds the status, headers and body, which can be a stream. Because every platform shares them, code written against them is portable.

Example

Next.js Route Handlers and middleware receive a Request and return a Response, extended as NextRequest and NextResponse.

Related terms

Taught in

References