In this step, we will test operation of the APIs using Postman tool.
Test the listing API
Click + to add a new tab
Select GET method
Enter URL of the listing API that recorded from the previous step
Click Send
The returned result is the entire data of the Books table that has been processed
Test the writing API
Similarly create a new tab
Select POST method
Enter URL of the writing API that recorded from the previous step
In Body pattern, select raw
Copy the below text block:
{
"id": "5",
"rv_id": 0,
"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": "https://book-image-resize-store.s3.ap-southeast-2.amazonaws.com/aws.jpg"
}
Switch to Headers
Add KEY is Content-Type, VALUE is application/json
Click Send
Wait a moment, see the results returned
Open Books table in DynamoDB console to check data
Before call the write API
After call the write API
Test the deleting API
Since the delete Lambda function on execution deletes images uploaded by the user, we manually upload the images to the S3 bucket so the API can run properly.