Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@twhiteman
Copy link
Contributor

Works similar to the curl --verbose option.

@legal90
Copy link
Owner

legal90 commented Feb 3, 2025

Thank you for the PR, @twhiteman!
Unfortunately, I don't have a possibility to verify it now with valid AWS credentials.
Would you mind posting the example of the output of awscurl with that feature?
Thanks!

@toddw-as
Copy link

toddw-as commented Feb 3, 2025

Regular call:

$ ./awscurl --service ec2 --profile dummy --region us-wes
t-2 'https://ec2.amazonaws.com?Action=DescribeRegions&Version=2013-10-15'
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>870b1f2f-a08d-4d9c-938b-b9d8e6331b66</RequestID></Response>

With debug:

$ ./awscurl --service ec2 --profile dummy --region us-west-2 'https://ec2.amazonaws.com?Action=DescribeRegions&Version=2013-10-15' --debug
REQUEST GET /?Action=DescribeRegions&Version=2013-10-15 HTTP/1.1
Host: ec2.amazonaws.com
User-Agent: Go-http-client/1.1
Authorization: AWS4-HMAC-SHA256 Credential=ABCDEF1234567890ABCD/20250203/us-west-2/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=9e2da7dbc8f78379920604765b635f60ccd9e0b948478097574405e209f24927
Content-Type: application/x-amz-json-1.1
X-Amz-Date: 20250203T161532Z
Accept-Encoding: gzip

RESPONSE HTTP/1.1 401 Unauthorized
Transfer-Encoding: chunked
Cache-Control: no-cache, no-store
Content-Type: text/xml;charset=UTF-8
Date: Mon, 03 Feb 2025 16:15:32 GMT
Server: AmazonEC2
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: accept-encoding
X-Amzn-Requestid: ef614978-a544-4137-a3ee-47e697d2a3a1

fe
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>ef614978-a544-4137-a3ee-47e697d2a3a1</RequestID></Response>
0


<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>AuthFailure</Code><Message>AWS was not able to validate the provided access credentials</Message></Error></Errors><RequestID>ef614978-a544-4137-a3ee-47e697d2a3a1</RequestID></Response>

@legal90 legal90 merged commit a0fa90a into legal90:master Feb 4, 2025
@legal90
Copy link
Owner

legal90 commented Feb 4, 2025

Thank you!

Released as 0.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants