Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gbvanrenswoude/9f50fc5a1a17876bbe0d857fec1a4bd3 to your computer and use it in GitHub Desktop.
Save gbvanrenswoude/9f50fc5a1a17876bbe0d857fec1a4bd3 to your computer and use it in GitHub Desktop.
from requests_aws4auth import AWS4Auth
import boto3
import requests
credentials = boto3.Session().get_credentials()
awsauth = AWS4Auth(credentials.access_key, credentials.secret_key, 'eu-central-1', 'es', session_token=credentials.token)
r = requests.get(url, auth=awsauth)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment