我尝试使用SAS将块blob上传到Azure存储。我已成功上传了这些块(通过调用GET阻止列表进行了验证),但我无法使PUT阻止列表正常工作。我得到了错误的请求400"回来。
使用UTF8(Swift)编码正文:
body.dataUsingEncoding(NSUTF8StringEncoding)!
以下是请求和回复:
URL: http://myMovies.blob.core.windows.net:80/movies-pub/LTE6BB22F5-703F-4CA6-9BDE-A8F0DFBD3964.mp4?se=2015-06-14T23%3A21%3A42Z&sr=b&sp=rw&sig=EqUOKdjbz2YJfJDkZP7c2YRWvGow70T8dLJym4fy9iA%3D&comp=blocklist
BODY: "<?xml version=\"1.0\" encoding=\"utf-8\"?><BlockList><Latest>MDAwMDAw</Latest><Latest>MDAwMDAx</Latest></BlockList>"
Server Response: 400
AllHeaderFields: {
"Accept-Language" = "en;q=1, da;q=0.9, de;q=0.8, es;q=0.7, fr;q=0.6";
"Content-Length" = 111;
"Content-Type" = "text/plain; charset=UTF-8";
"User-Agent" = "MyApp/1.0 (iPhone; iOS 8.3; Scale/2.00)";
"x-ms-blob-content-type" = "video/mp4";
}
Error: Request failed: bad request (400)
答案 0 :(得分:0)
As Zhaoxing has already mentioned, I also see that "sv=" is missing.