Request template for POST methods

When a POST is received, which is the template I should define for the request?

Example:

Body POST:

{
“email”: "xxxxx@xxxxx.com",
password:“a password”
}

How can I define a template for this body post in serverless.yml file?

Thank you in advance

Hey @endymion,

You actually do not need to. If you deploy with v1.0.0-rc1 or greater you should receive your event in your handler as

{ body: { email: "email", password: "password" } }

automatically. If you do want to do something more fancy, the docs you are looking for are here: https://github.com/serverless/serverless/blob/master/docs/02-providers/aws/events/01-apigateway.md

Cheers!

Hi @ianserlin,

Thank you very much for your help! :slight_smile: