okigan / awscurl

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

Issue with executing URL with query string. #27

Closed Rushikesh005 closed 6 years ago

Rushikesh005 commented 6 years ago

I'm facing an issue with executing a API Gateway URL.

./awscurl.py -X GET --region us-west-2 --access_key XXXXXXXXXXXX --secret_key XXXXXXXXXXXXXXXXX --service execute-api """https://xxxxx.execute-api.us-west-2.amazonaws.com/XX/YY/ZZZ?ids=[\{\"id\":\"aaaaa-bbb-cccc-dddd-1234567\"\}]&pid=aaaaa-bbb-cccc-dddd-1234567"""

I'm getting following response, {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."} Traceback (most recent call last): File "awscurl.py", line 334, in sys.exit(main()) File "awscurl.py", line 329, in main args.security_token or args.session_token File "awscurl.py", line 232, in make_request return send_request(uri, data, headers, method) File "awscurl.py", line 262, in send_request r.raise_for_status() File "/opt/VRTSitrpgw/venv27/lib/python2.7/site-packages/requests/models.py", line 935, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url:

Any help is appreciated.

okigan commented 6 years ago

check escaping happening in your command line/shell, here is a simple example that works with query params:

awscurl --service s3 https://awscurl-sample-bucket.s3.amazonaws.com?a=b

okigan commented 6 years ago

@Rushikesh005 closing this issue as stale -- contact/create a new issue if the problem re-occurs.