NextRequest
Next.js' extension of the Web Request object, adding a cookies helper and nextUrl, a parsed URL with Next.js routing details.
In more detail
Route Handlers and middleware can receive it. In Next.js 15 the geo and ip properties were removed; hosting platforms now provide location and IP helpers, such as geolocation() from @vercel/functions.
Related terms
- NextResponse — Next.js' extension of the Web Response object, with helpers for JSON responses, cookies, redirects and rewrites.
- 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.
- geolocation — Estimating where in the world a device or user is, usually from their IP address, so that a security rule can allow or refuse access by location.
Taught in
- Route Handlers: RESTful Endpoints with NextRequest — Next.js 15 & Modern App Router Architecture