Test APIs by Postman

In this step, we will test operation of the APIs using Postman tool.

Test the listing API

  1. Click + to add a new tab.
    • Select GET method.
    • Enter URL of the listing API that recorded from the previous step.
    • Click Send. TestListAPI The returned result is the entire data of the Books table that has been processed.

Test the writing API

  1. Similarly create a new tab.

    • Select POST method.
    • Enter URL of the writing API that recorded from the previous step.
    • Choose Body.
    • Choose form-data.
    • Fill Key and Value as below. Change type of Key image to File as image below. And with Value of Key image, choose your local file path.
      • id: 5
      • name: Amazon Web Services in Action 2nd Edition
      • author: Andreas Wittig
      • price: 59.99
      • category: IT
      • description: Amazon Web Services in Action, Second Edition is a comprehensive introduction to computing, storing, and networking in the AWS cloud. You’ll find clear, relevant coverage of all the essential AWS services you to know, emphasizing best practices for security, high availability and scalability
      • image: aws-logo.png
    • Click Send. Wait a moment, see the results returned Successfully created item. TestListAPI
  2. Open Books table in DynamoDB console to check data

    • Before call the write API. TestListAPI
    • After call the write API. TestListAPI

Test the deleting API

  1. Similarly create a new tab.

    • Select DELETE method.
    • Enter URL of the writing API that recorded from the previous step. Change {id} to book_id you want to delete, such as 5.
    • Click Send. Wait a moment, see the results returned Successfully delete item!. TestListAPI
  2. Open Books table in DynamoDB console to check data. TestListAPI

  3. Open book-image-resize-stores-by-myself bucket to check object. The aws-logo.jpg is deleted. TestListAPI