Properties

id

Transaction ID Example: dc6128b3-bdcb-464d-a1e1-009b041ff9b9

stage

If you are working with API Gateway Stages, it will contain a value. Example: develop.

If you set no stage in the Gateway API by default it will be empty.

method

Identifies the HTTP Method. Possible values: GET, PUT, POST, etc.

path

Identify the URL. Example: /users.

query

Returns in an object all parameters that were passed in the URL query. Example: {id: 100}

params

By default, return an empty object. If you do not work with the API class to be able to assign it a value must use the function: getRouteParams(route, path).

headers()

Returns an array of all headers in the request. Header names will be lowercase.

body

Returns an object with all the parameters returned in the request body. Only works with content-type application/json or application/x-www-form-urlencoded.

NOTE: Doesn't support binary content. Example: files.

host

Returns the host that invoked the request.

If ALB, the DNS will return.

If API Gateway will return the domain.

ip

Returns the first ip found in the request.

userAgent

Returns the User-Agent sent in the header.

proxyIntegration

Identifies what integration your Lambda has.

The values to return are: elb or apigw-rest-api or apigw-http-api.

isBase64Encoded

A Boolean value that identifies whether the body is in base64

log

Property that allows you to manage the log on each request.

connectionId

Property that returns the id of the socket connection. This value can be nullable

route

property that returns the router key to be used with the ApiSocket.

You can add additional parameters if you are working with ApiRouter or ApiSocket this will allow you to have more customization when you are using middlewares.

Last updated

Was this helpful?