Processing Request Parameters
You now add a handler to deal with form submissions. You did not set a specific form action URL, but you did set the form
POST. When the form is submitted, this will make your browser send the information to the same URL where the form was displayed, but it will be using the HTTP POST method. You can use the method to differentiate between actions. If the Lambda function receives a
GET call, it can show the form. If it receives a
POST call, it can process the submission.
In Chapter 4, you added some simple event logging into the sample function. Open the CloudWatch log and look at one of those events. You’ll see that the method is in the
httpMethod field of the event.