AnomalyInnovations / aws-api-gateway-cli-test

A simple CLI to test API Gateway endpoints with IAM authorization
MIT License
120 stars 29 forks source link

TypeError: argv.body.startsWith is not a function #20

Closed Dave-Lopper closed 4 years ago

Dave-Lopper commented 4 years ago

Hello guys !

Little issue while using the aws-api-gateway-cli-test, but I'm pretty new to AWS, I am just following a tutorial so far, so apologies in advance if this issue isn't one.. But I searched the web for a similar error related to the test cli and didn't find one..

So here it is, I tried both methods :

npx aws-api-gateway-cli-test \ --username=MY_USER_NAME \ --password=MY_PASSWORD \ --user-pool-id=MY_POOL_REGION \ --app-client-id=MY_APP_CLIENT_ID \ --cognito-region=MY_COGNITO_REGION \ --identity-pool-id=MY_POOL_ID \ --invoke-url=MY_GATEWAY_URL \ --api-gateway-region=MY_GATEWAY_REGION \ --path-template=/notes \
--method=POST \ --body={"content":"hello world","attachment":"hello.jpg"}

and

npm i -g aws-api-gateway-cli-test
apig-test \ --username=MY_USER_NAME \ --password=MY_PASSWORD \ --user-pool-id=MY_POOL_REGION \ --app-client-id=MY_APP_CLIENT_ID \ --cognito-region=MY_COGNITO_REGION \ --identity-pool-id=MY_POOL_ID \ --invoke-url=MY_GATEWAY_URL \ --api-gateway-region=MY_GATEWAY_REGION \ --path-template=/notes \ --method=POST \ --body={"content":"hello world","attachment":"hello.jpg"}

Both are returning the same output for me :

Authenticating with User Pool Getting temporary credentials Making API request /usr/local/lib/node_modules/aws-api-gateway-cli-test/index.js:172 if (argv.body.startsWith("@")) { ^

TypeError: argv.body.startsWith is not a function at makeRequest (/usr/local/lib/node_modules/aws-api-gateway-cli-test/index.js:172:17) at /usr/local/lib/node_modules/aws-api-gateway-cli-test/index.js:152:5 at /usr/local/lib/node_modules/aws-api-gateway-cli-test/node_modules/aws-sdk/lib/credentials.js:124:23 at /usr/local/lib/node_modules/aws-api-gateway-cli-test/node_modules/aws-sdk/lib/credentials.js:212:15 at processTicksAndRejections (internal/process/task_queues.js:79:11)

Thank you in advance, and sorry again if this id an error on my side

Dave-Lopper commented 4 years ago

Woops, I am sorry, I was missing the parameters quotes. Closing the issue.