Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.63 KB | None | 0 0
  1. private Dictionary<string, string>[] getInitUploadRequestsData(IRestResponse initUploadSignedResponse)
  2.         {
  3.             int numberOfRequests = (int)getInitUploadCommonData(initUploadSignedResponse)["NumberOfRequests"];
  4.             Dictionary<string, string>[] requestsDataArray = new Dictionary<string, string>[numberOfRequests];
  5.  
  6.             InitUploadSignedResponse initUploadSignedResponseJson = JsonConvert.DeserializeObject<InitUploadSignedResponse>(initUploadSignedResponse.Content);
  7.  
  8.             for (int i = 0; i < numberOfRequests; i++)
  9.             {
  10.                 Dictionary<string, string> requestData = new Dictionary<string, string>();
  11.                 string blobName = initUploadSignedResponseJson.RequestToUploadFileList[i].BlobName;
  12.                 string fileName = initUploadSignedResponseJson.RequestToUploadFileList[i].FileName;
  13.                 string blobUrl = initUploadSignedResponseJson.RequestToUploadFileList[i].Url;
  14.                 string method = initUploadSignedResponseJson.RequestToUploadFileList[i].Method;
  15.                 string xmsBlobType = "";
  16.                 string contentMd5 = "";
  17.                 foreach (Header header in initUploadSignedResponseJson.RequestToUploadFileList[i].HeaderList)
  18.                 {
  19.                     if (header.Key.Equals("x-ms-blob-type"))
  20.                     {
  21.                         xmsBlobType = header.Value;
  22.                     }
  23.                     if (header.Key.Equals("Content-MD5"))
  24.                     {
  25.                         contentMd5 = header.Value;
  26.                     }
  27.                 }
  28.  
  29.                 requestData.Add("BlobName", blobName);
  30.                 requestData.Add("FileName", fileName);
  31.                 requestData.Add("Url", blobUrl);
  32.                 requestData.Add("Method", method);
  33.                 requestData.Add("Content-MD5", contentMd5);
  34.                 requestData.Add("x-ms-blob-type", xmsBlobType);
  35.  
  36.                 requestsDataArray[i] = requestData;
  37.             }
  38.  
  39.             return requestsDataArray;
  40.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement