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

body from file #16

Closed ozbillwang closed 4 years ago

ozbillwang commented 5 years ago

with curl or other tools, I can easily feed the body from a file. It will be convenience for testing.

Could we have the same feature with aws-api-gateway-cli-test? Such as:

  --body="@/path/to/filename"

I did a try, but seems this feature is not ready currently.

Authenticating with User Pool
Getting temporary credentials
Making API request
undefined:1
@mocks/create.json
^

SyntaxError: Unexpected token @ in JSON at position 0

Reference: https://stackoverflow.com/questions/15912924/how-to-send-file-contents-as-body-entity-using-curl

ozbillwang commented 5 years ago

Let me try if I can make the PR. The related change will be at:

https://github.com/AnomalyInnovations/aws-api-gateway-cli-test/blob/454b5bc8cfaf722d14af675d6318b3f91f1752d4/index.js#L168