Skip to main content

Request Handling for Expresss

Request handling in Express is reading input from a request and building a correct response. Input arrives in req.params, req.query, req.body and req.headers, and the handler responds with res.json, res.status and headers, validating the input first so that bad data produces a clear 4xx response.

Stage: Building APIs · Part of the Express roadmap · Last reviewed 19 November 2026

What to learn in Request Handling

Request Handling interview questions

What is the difference between req.params and req.query?

req.params holds values captured from the path pattern, such as the id in /users/:id. req.query holds the parsed query string after the question mark, such as page and limit in /users?page=2. Both arrive as strings and need validation.

Why validate input on the server when the client already does?

Clients can be bypassed with tools like curl, so client checks are only convenience. The server must validate type, format and range of every input to prevent bad data, crashes and injection attacks.

Where Request Handling fits in the Express roadmap

Request Handling belongs to the Building APIs stage (beginner level). Real endpoints.

Back to the full Express roadmap