# Get

**Kind:** Constant

**Source:** [`packages/common/decorators/http/request-mapping.decorator.ts`](https://github.com/nestjs/nest/blob/master/packages/common/decorators/http/request-mapping.decorator.ts#L57)

**Part of:** [Common](subsystem-packages-common)

Route handler (method) Decorator. Routes HTTP GET requests to the specified path.

`Get` is a route handler decorator that maps an HTTP `GET` request to a controller method. Use it to expose read-oriented endpoints, optionally providing a path that is combined with the controller's base route.

## Definition

```ts
createMappingDecorator(RequestMethod.GET)
```

## Value

```ts
createMappingDecorator(RequestMethod.GET)
```

## Diagram

```mermaid
graph LR
  Client[HTTP Client] -->|GET /users/:id| Controller[Controller Base Path: /users]
  Controller --> Get["@Get(':id')"]
  Get --> Handler[Controller Method]
  Handler --> Response[HTTP Response]
```

## Usage

```ts
import { Controller, Get, Param } from '@nestjs/common';

@Controller('users')
export class UsersController {
  @Get(':id')
  findOne(@Param('id') id: string) {
    return {
      id,
      name: 'Ada Lovelace',
    };
  }

  @Get()
  findAll() {
    return [];
  }
}
```

## AI Coding Instructions

- Apply `@Get()` only to controller methods that handle HTTP `GET` requests.
- Provide a relative route path such as `':id'` or `'search'`; it is combined with the enclosing `@Controller()` path.
- Use parameter decorators such as `@Param()`, `@Query()`, and `@Headers()` to access request data instead of manually parsing the request where possible.
- Keep `GET` handlers read-oriented and avoid side effects; use `@Post()`, `@Patch()`, or `@Delete()` for state-changing operations.

## Used by

77 references from 77 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Imported by (77)

- `AppController` — `integration/cors/src/app.controller.ts`:3
- `ErrorsController` — `integration/hello-world/src/errors/errors.controller.ts`:3
- `HelloController` — `integration/hello-world/src/hello/hello.controller.ts`:6
- `HostController` — `integration/hello-world/src/host/host.controller.ts`:6
- `HostArrayController` — `integration/hello-world/src/host-array/host-array.controller.ts`:6
- `AppV1Controller` — `integration/inspector/src/app-v1.controller.ts`:3
- `AppV2Controller` — `integration/inspector/src/app-v2.controller.ts`:3
- `CatsController` — `integration/inspector/src/cats/cats.controller.ts`:8

…and 69 more.
