Test methods of REST API Gateway

In this section, we’ll test our REST API Gateway endpoints using the AWS Management Console. The console provides a user-friendly interface to verify each endpoint’s functionality before deploying to a stage.

Testing Process

  1. Access the Test tab of each API resource - method

    • Navigate to API Gateway in AWS Console
    • Select your API and the desired resource/method
    • Open the Test tab
  2. Test each resource - method

    API Resource - MethodLambda FunctionTest requirement
    /users GETlist-usersReturn all users from the
    /users POSTcreate-userA new user is added to the system
    /users/{userId} GETget-userReturn detail of a specific user
    /users/{userId} PATCHupdate-userThe user detail is updated with the new data
    /users/{userId} DELETEdelete-userThe user is removed from the system
  3. Verify Responses

    • Check HTTP status codes
    • Validate response payloads
    • [Optional] Review CloudWatch logs for Lambda execution details

The Management Console’s test feature allows you to quickly validate your API without needing to deploy it to a stage, making it ideal for development and debugging.

Content

  1. Test /users - GET method
  2. Test /users - POST method
  3. Test /users/{userId} - GET method
  4. Test /users/{userId} - PATCH method
  5. Test /users/{userId} - DELETE method