Add POST Method

Configure POST /hello

  • Select the /hello resource → Add method → POST → Lambda Function.
  • Choose the same Lambda function used for GET.
  • Use Lambda proxy integration (recommended) so Lambda receives the full request; parse event.body (JSON) in the function. image

Deploy & Test

  • Redeploy the dev stage.
  • Test the endpoint:
curl -X POST -H "Content-Type: application/json" \\
  -d '{}' \\
  \"https://<id>.execute-api.<region>.amazonaws.com/dev/hello\"
  • Ensure the JSON response returns the correct name; check CloudWatch logs if there are errors.

image