Comments for Test the APIs

@gerhartz I just had the same issue:

/Users/gregsabo/.npm/_npx/ea84c6478cf14779/node_modules/aws-api-gateway-cli-test/index.js:172
  if (argv.body.startsWith("@")) {
                ^

TypeError: argv.body.startsWith is not a function

Switching to the latest version of node (15.6.0) worked for me. I’m using the n command line tool to switch between versions of node.

1 Like

Hi did u find the solution? Please drop the solution if u made it correct.

While deploying npx aws-api-gateway-cli-test --username admin@example.com --password Passw0rd! --user-pool-id ap-south-1_SYjb2OivU --app-client-id 7gsle022gaatifrb70t98h2kov --cognito-region ap-south-1 --identity-pool-id ap-south-1:1b5c0d81-cd72-4692-8ba5-7481fa10de8e --invoke-url https://wx592asuj5.execute-api.ap-south-1.amazonaws.com/prod --api-gateway-region ap-south-1 --path-template /notes --method POST --body "{\"content\":\"hello world\",\"attachment\":\"hello.jpg\"}"

I used to get the error like

Authenticating with User Pool
Getting temporary credentials
Making API request
undefined:1
{\
 ^

SyntaxError: Unexpected token \ in JSON at position 1

SO I DID SOME CHNAGES AND ABLE TO GET THE SOLUTION.

  1. Clear the cache npm cache clean --force
  2. Then deploy the code in cmd, it doesn’t work for terminals…

It works fine.