I am using Azure storage rest apis in a java program and trying to create a pageblob and then upload a vhd using put page.
Here is my code:
url = String.format("https://myaccount.blob.core.windows.net/vhds/mypageblob");
Date now = new Date();
SimpleDateFormat dateFormatter = new SimpleDateFormat("E, dd MMM yyyy hh:mm:ss zzz");
dateFormatter.setTimeZone(TimeZone.getTimeZone("GMT"));
requestHeaders.put( "x-ms-date", dateFormatter.format(now));
requestHeaders.put( "x-ms-blob-type", "PageBlob");
requestHeaders.put("x-ms-blob-content-length", "4096");
requestHeaders.put("x-ms-blob-sequence-number", "0");
requestHeaders.put("Authorization", "SharedKey");
// Use api to get the shared key.
requestHeaders.put("myaccount", primary_key);
I get an error 'The value for one of the HTTP headers is not in the correct format. 400'. Any idea how i can debug this?