Azure storage 'put block list' returns 400

444 views Asked by At

I'm trying to upload block blobs to Azure storage using SAS. I have successfully uploaded the blocks (validated by calling GET blocklist) but I can't get the PUT blocklist to work. I get "bad request 400" back.

The body is encoded using UTF8 (Swift):

body.dataUsingEncoding(NSUTF8StringEncoding)!

Here are the request and response:

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)
1

There are 1 answers

0
Michael Curd On

As Zhaoxing has already mentioned, I also see that "sv=" is missing.