我在尝试锻炼如何列出所有容器和 blob 时遇到了困难。奇怪的是,我还没有看到一个这样做的 Coldfusion 示例。
我试过关注一个 C# 项目,但我被困在创建签名的地方。以下是到目前为止我从 C# 项目中提取的内容。
资源数组 - 这些是我想调用的一些资源
- restype=container&comp=list&include=snapshots&include=元数据
- 比较=列表
- 容器 + "/" + blob + "?comp=pagelist
- 容器 + "/" + blob + "?comp=blocklist
我从 C# 逻辑中提取的内容
<cfhttp method="GET" url="http://#arguments.storageAccount#.#variables.hostEndPoint[storageType]#?#resource[1]#">
<cfhttpparam type="header" name="x-ms-date" value="#dateTimeString#" />
<cfhttpparam type="header" name="x-ms-version" value="2009-09-19" />
<cfhttpparam type="header" name="Authorization" value="??????" />
</cfhttp>
由于我不是 C# 开发人员,如果有人可以解释下面的结果是什么,我可以转换它。
MessageSignature 是否是以下值的逗号分隔列表(即 '{0}\n\n\n{1}\n{5}\n\n\n\n{2}\n\n\n\ n{3}{4},GET,,无论 ifMatch 返回什么,...')
MessageSignature = String.Format("{0}\n\n\n{1}\n{5}\n\n\n\n{2}\n\n\n\n{3}{4}",
method,
(method == "GET" || method == "HEAD") ? String.Empty : request.ContentLength.ToString(),
ifMatch,
GetCanonicalizedHeaders(request),
GetCanonicalizedResource(request.RequestUri, StorageAccount),
md5
);
以下示例字符串将返回什么(例如“复杂 Azure!”)
byte[] SignatureBytes = System.Text.Encoding.UTF8.GetBytes(MessageSignature);
谢谢你。