在进行PUT
请求时,使用正确的授权标头,创建新的BLOB,当我尝试将文件放入容器时,我的过程出现“404资源未找到”错误。
https://accountNameHere.blob.core.windows.net/containerNameHere
容器名和帐户名都是正确的。
为什么会失败?
这里是原始请求头:
PUT /testss HTTP/1.1
Host: accountName.blob.core.windows.net
Accept: */*
Connection: Keep-Alive
0: content-encoding
1: content-language
2: content-length
3: content-md5
4: content-type
5: date
6: if-modified-since
7: if-match
8: if-none-match
9: if-unmodified-since
10: range
x-ms-blob-type: BlockBlob
x-ms-version: 2011-08-18
x-ms-date: Fri, 09 Aug 2013 04:17:59 GMT
Content-Length: 126377
Authorization: SharedKey accountName:MBVLmoxzxZr+tf8EZw2GkbFLEHuNn8FNAaEHrcty/cM=
Expect: 100-continue
这是我发送的待签字符串:
PUT x-ms-blob-type:BlockBlob x-ms-date:Fri, 09 Aug 2013 04:03:20 GMT x-ms-version:2011-08-18 /accountName/test
以下是他们的期望:
PUT 126377 x-ms-blob-type:BlockBlob x-ms-date:Fri, 09 Aug 2013 04:02:17 GMT x-ms-version:2011-08-18 /accountName/test
两者唯一的区别就是 PUT
后面的 126377
。那是文件的内容长度,我只是不确定如何去掉它。