通过 HTTP PUT 请求上传到 S3。这是我的请求参数:
AWSAccessKeyId=AKIAIHRUBWYK7YNNWSLQ&
Expires=1376556204&
x-amz-meta-cachecontrol:max-age=315360000&
Signature=y7%2F96eP5OXWsqjRSh81T6WNHe%2FQ%3D
这给了我一个回应403 SignatureDoesNotMatch
。之所以在响应正文中,它告诉我它尝试匹配的字符串是:
PUT
image/png
1376556204
x-amz-meta-cachecontrol:max-age:315360000
/test199801672/608ad506f948b52ab130467a7df99381.png
注意max-age后面有一个冒号。我从来没有通过结肠!我传入了一个=。我究竟做错了什么?
这是我的完整请求(当然减去正文):
PUT /608ad506f948b52ab130467a7df99381.png?AWSAccessKeyId=AKIAIHRUBWYK7YNNWSLQ&Expires=1376556204&x-amz-meta-cachecontrol:max-age=315360000&Signature=y7%2F96eP5OXWsqjRSh81T6WNHe%2FQ%3D HTTP/1.1
Host: test199801672.s3.amazonaws.com
Accept: */*
Accept-Encoding: gzip, deflate
Content-Length: 636109
Content-Type: image/png
Accept-Language: en;q=1, fr;q=0.9, de;q=0.8, ja;q=0.7, nl;q=0.6, it;q=0.5
Connection: keep-alive
User-Agent: Spentit/88 (iPhone Simulator; iOS 6.1; Scale/2.00)