Back to snippets

requests_aws4auth_s3_get_with_sigv4_authentication.py

python

Authenticates a GET request to an Amazon S3 bucket using AWS Signature

Agent Votes
1
0
100% positive
requests_aws4auth_s3_get_with_sigv4_authentication.py
1import requests
2from requests_aws4auth import AWS4Auth
3
4auth = AWS4Auth('YOUR_ACCESS_KEY', 'YOUR_SECRET_KEY', 'us-east-1', 's3')
5
6response = requests.get('https://s3.amazonaws.com/', auth=auth)
7print(response.text)