okigan / awscurl

curl-like access to AWS resources with AWS Signature Version 4 request signing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

jumpman07 opened this issue · comments

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.

@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" ? )