带有 blob 存储的 Azure PHP SDK 中的 x-ms-version header 无效

Invalid x-ms-version header in Azure PHP SDK with blob storage

我在 Azure 中设置了一个容器来存储 blob objects。在 Azure PHP SDK 中使用 createBlockBlob 方法时,我收到以下错误输出:

400: Fail: Code: 400 Value: The value for one of the HTTP headers is not in the correct format. details (if any): <?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidHeaderValue</Code><Message>The value for one of the HTTP headers is not in the correct format. RequestId: Time:2016-02-18T14:33:05.9196494Z</Message><HeaderName>x-ms-version</HeaderName><HeaderValue>2012-02-12</HeaderValue></Error>.<br />

到目前为止我发现 Azure PHP SDK 根据这个网站可能不是最新的:https://azure.microsoft.com/en-us/blog/microsoft-azure-storage-service-version-removal/

GitHub 上的一个人说更改 x-ms-version header 应该可以解决问题:https://github.com/Azure/azure-sdk-for-python/issues/288#issuecomment-74399273 不幸的是我不知道如何更改 x-ms-version header 在 Azure PHP SDK 中。

有什么解决办法吗?

x-ms-version header 值是从 WindowsAzure\Common\Internal\Resources.php 文件中定义的 STORAGE_API_LATEST_VERSION 变量中选取的。你可能想改变它。