小编Jor*_*her的帖子

使用ASP.NET在Windows Azure blob存储上设置CORS

我正在尝试在我的Windows Azure blob存储帐户上设置CORS属性.我正在使用ASP.NET服务器发送PUT请求.

服务器正在发回Forbidden响应,说" 服务器无法验证请求.请确保正确形成授权标头的值,包括签名. "

所以它必须是我的身份验证标题中的内容.以下是我用来获取标题的两个函数.

public string GetWindowsAzureAuthenticationHeader(string verb)
{
    string stringToSign = String.Format("{0}\n"
                                        + "\n" // content encoding
                                        + "\n" // content language
                                        + "\n" // content length
                                        + "\n" // content md5
                                        + "\n" // content type
                                        + "\n" // date
                                        + "\n" // if modified since
                                        + "\n" // if match
                                        + "\n" // if none match
                                        + "\n" // if unmodified since
                                        + "\n" // range
                                        + "x-ms-date:" + DateTime.UtcNow.ToString("R") + "\nx-ms-version:2013-08-15\n" // headers …
Run Code Online (Sandbox Code Playgroud)

c# asp.net azure

4
推荐指数
1
解决办法
1308
查看次数

标签 统计

asp.net ×1

azure ×1

c# ×1