The HttpScope interface which is passed to the controller method provides access to the incoming request data.
The request object provides access to the request body and query parameters.
export class UserController {
  @Route({method: 'POST', path: '/users'})
  store({request}: HttpScope) {
    const {body, query} = request;
  }
}
If you need to allow file uploads on a specific route, you need to pass multipart: true in the route options.
export class UserController {
  @Route({method: 'POST', path: '/users', options: {multipart: true}})
  store({request}: HttpScope) {
    // assuming `avatar` is the name of the file input
    const avatar = scope.request.files?.avatar as unknown as UploadedFile;
  }
}
The request object contains information about the incoming request, such as path, host, and method.
export class UserController {
  @Route({method: 'POST', path: '/users'})
  store({request}: HttpScope) {
    const {path, host, method} = request;
  }
}
You can access the request parameters using the params property.
export class UserController {
  @Route({method: 'GET', path: '/users/:id'})
  show({request}: HttpScope) {
    const {params} = request;
    const userId = params.id;
  }
}
You can access the request headers using the headers property.
export class UserController {
  @Route({method: 'POST', path: '/users'})
  store({request}: HttpScope) {
    const {headers} = request;
    const contentType = headers['content-type'];
  }
}