How can I calculate an AWS API signature (v4) in python?
问题 I'm attempting to generate a signature for an Amazon Glacier upload request, using the example requests and example functions provided by the AWS documentation, but I can't make it work. At this point, I'm certain I'm missing something incredibly obvious: #!/bin/env python import hmac import hashlib # This string to sign taken from: http://docs.amazonwebservices.com/amazonglacier/latest/dev/amazon-glacier-signing-requests.html#example-signature-calculation sts = """AWS4-HMAC-SHA256