![](/img/trans.png)
[英]What do I need to tell clients re. Firewalls in order to ensure our Azure.Storage.Blobs dependent software will work?
[英]Azure.Storage.Blobs support for localDevelopment throws The value for one of the HTTP headers is not in the correct format
从 Microsoft.Azure.Blob 升级到 Azure.Storage.Blobs 后,我正在尝试通过一些单元测试。 我与 BlobServiceClient 的连接是
// create service client:
var blobServiceClient = BlobServiceClient("UseDevelopmentStorage=true")
//create container
BlobContainerClient container = client.GetBlobContainerClient(containerName);
//my code blows up on 'container.exists()'...but I don't get read access error.
//RequestFailedException : "The value for one of the HTTP headers is not in the correct format."
if(!container.Exists())
container = client.CreateBlobContainer(containerName).Value;
BlobClient blobClient = container.GetBlobClient($"{blobName}.json");
await blobClient.UploadAsync(BinaryData.FromString(jsonContent), options);
想知道是否有人知道使用 azurite 和最新的库是否有一些限制? 检查我的容器,它在我看来“没问题”吗? 我也尝试使用 Microsoft Azure 存储资源管理器中提供的连接字符串,但遇到了同样的问题。 我不明白我的标头不正确是什么意思。 其他答案都与功能有关,而且还有 4 岁。 我觉得这个问题与我的单元测试设置有关。
实际错误信息:
The value for one of the HTTP headers is not in the correct format.
RequestId:5b9f9072-606b-4dfa-b174-19ef2fa2c20d
Time:2023-01-27T00:02:23.357Z
Status: 400 (The value for one of the HTTP headers is not in the correct format.)
ErrorCode: InvalidHeaderValue
Additional Information:
HeaderName: x-ms-version
HeaderValue: 2021-10-04
Content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error>
<Code>InvalidHeaderValue</Code>
<Message>The value for one of the HTTP headers is not in the correct format.
RequestId:5b9f9072-606b-4dfa-b174-19ef2fa2c20d
Time:2023-01-27T00:02:23.357Z</Message>
<HeaderName>x-ms-version</HeaderName>
<HeaderValue>2021-10-04</HeaderValue>
</Error>
Headers:
Server: Azurite-Blob/3.17.1
x-ms-error-code: InvalidHeaderValue
x-ms-request-id: 5b9f9072-606b-4dfa-b174-19ef2fa2c20d
Date: Fri, 27 Jan 2023 00:02:23 GMT
Connection: keep-alive
Keep-Alive: REDACTED
Transfer-Encoding: chunked
Content-Type: application/xml
发生此错误是因为您安装的 Azurite (v3.17.1) 支持的存储 REST API 版本不是您正在使用的 SDK (12.14.1) 版本支持的最新版本 REST API。
要解决此问题,有几个选项:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.