📝 Edit page
➕ Add page
Event
Fields on the event
object.
event.path
- The request path.
- e.g.
/.netlify/functions/abc
. - e.g. Requesting the ABC function with
/.netlify/functions/abc/def.json
event.path // "/.netlify/functions/abc/def.json" const name = event.path.split("/")[4]; // "def.json"
event.httpMethod
the request HTTP method e.g."GET"
.event.headers
the request headersevent.queryStringParameters
- The request query parameters. e.g.
/.netlify/functions/abc?a=b&d=123
as{ a: "b", d: 123 }
. - For URL with
?myParam=foo
, get withconst myParam = event.queryStringParameters.myParam;
- The request query parameters. e.g.
event.body
the request body in JSON format. Such as if receiving data on a POST.