# Input Request

The **input request** is any input we'd expect from the client to send to our API. They can be in the form of URI parameters, headers, body content, and more.

A good way to know if something is an input request would be to just look at the Express documentation of all the `req` properties.

![https://expressjs.com/en/api.html#req](/files/XcipAXIBq9oKkAitLnSF)

The goal of this step is to know what exactly we'd expect from the client and to create some sort of contract between us, the server, and the client calling our RESTful API. To do so, we will use what are called **Data Transfer Objects**.

## Using Data Transfer Objects

Data Transfer Objects (DTOs) are objects that carry and transform data in between processes. They are extremely useful when you want to customize properties of data that you want be exposed or hidden. They are objects that can create adapter-like layers in order to smoothly control the input and output flow of data between different function calls within your application.

In many other typed languages such as Java or C#, the built-in verbosity of those languages require you to type hint your input and output based on custom classes you would declare, making it easy to declare some sort of contract between the caller and callee.

In JavaScript land however, we do not have that, at least not in raw native JavaScript. This is why it is important to create some sort of DTO, so that we may not only create those contracts, but also create a **self-documenting source of truth within our codebase**. DTOs will be used heavily in our project in the upcoming chapters and will be illustrated as we get closer to looking at the code.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://book.restfulnode.com/part-2/chapter-5/2-input-request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
