#Need help with Amplify CLI API: POST request not working in Postman

3 messages · Page 1 of 1 (latest)

wild wedge
#

Hi everyone,

I'm new to using Amplify CLI and I'm having some trouble with my API. I have created an API with a Lambda function that retrieves data using a GET request, and another Lambda function that inserts data into my database using a POST request.

When I run amplify mock function CreateItem, it successfully inserts data into my database. However, when I try to test the POST request using Postman, nothing happens. Do I need to create another API? Also, I couldn't find an option to choose a POST request when creating an API using the Amplify CLI.

I would appreciate any help or guidance on this issue. Thank you!

hasty crown
#

Hey 👋 by default routes creating with amplify add|update api allow any HTTP method, unless specified otherwise in an override. When you're attempting to test in Postman are you calling the deployed API endpoint? Does it return a response at all?

willow niche
#

Hi @wild wedge - do you still need help with this? Have you had a chance to see the comment by @hasty crown above?