okigan / awscurl

curl-like access to AWS resources with AWS Signature Version 4 request signing.
MIT License
737 stars 91 forks source link

Does awscurl not support fetching POST data from a json file? #121

Open jumpman07 opened 3 years ago

jumpman07 commented 3 years ago

Hi All,

I am trying to make a request to my API hosted on Amazon API Gateway. I put the request object in a file called request.json and am attempting to make a POST request as follows:

awscurl -v --service execute-api -X POST -d @"bin/request.json" "${endpoint}adduser"

Since I have enabled the verbose flag, I am seeing data field of my request as 'data': '@bin/request.json' . Any help is appreciated.

okigan commented 3 years ago

@jumpman07 that should work, relevant code is here: https://github.com/okigan/awscurl/blob/master/awscurl/awscurl.py#L453

so check that the file exists and your path to is correct (i.e. the "bin/request.json", should that be "./bin/request.json" ? )

KenanHH commented 5 months ago

+1