使用 Azure Storage REST API version >= 2019-02-02 指定文件系统属性

Specifying filesystem attributes with Azure Storage REST API version >= 2019-02-02

我正在尝试使用 Storage REST API 在文件存储中创建文件。从 2019-02-02 API 版本开始,这需要在 header 中指定一些文件系统参数。其中大多数我可以弄清楚或使用默认值,但有一个让我难过:

  • x-ms-file-attributes: Required. Version 2019-02-02 and newer. The file system attributes to be set on the file. See the list of available attributes.

可用属性列表只是 Win32 文件系统属性的 table,这在 http 上下文中不是很有用。

问题是,如何将这些属性指定为 http[s] 请求的一部分?我尝试了各种 header 值,例如 x-ms-file-attributes: Archivex-ms-file-attributes: None,但没有任何运气。

InvalidHeaderValue
The value for one of the HTTP headers is not in the correct format.
RequestId:bf47ff6b-001a-0086-6358-0854b5000000
Time:2020-04-01T19:08:28.8394578Z
x-ms-file-attributes
archive

x-ms-file-attributes: Nonex-ms-file-attributes: Archive 应该可以用,我用 postman 测试过,它可以用:

如果您使用的是代码,请将您的代码包含在 post 中,以便我们进行检查(您在代码中使用 archive 而不是 Archive 吗?)。我已经用 c# 测试了这个 api(版本 2019-02-02),没有问题。