Esempio n. 1
0
        private RESTCommand <AccountProperties> GetAccountPropertiesImpl(BlobRequestOptions requestOptions)
        {
            RESTCommand <AccountProperties> retCmd = new RESTCommand <AccountProperties>(this.Credentials, this.StorageUri);

            retCmd.CommandLocationMode    = CommandLocationMode.PrimaryOrSecondary;
            retCmd.BuildRequest           = (cmd, uri, builder, cnt, serverTimeout, ctx) => HttpRequestMessageFactory.GetAccountProperties(uri, serverTimeout, ctx, this.GetCanonicalizer(), this.Credentials);
            retCmd.RetrieveResponseStream = true;
            retCmd.PreProcessResponse     =
                (cmd, resp, ex, ctx) =>
                HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode.OK, resp, null /* retVal */, cmd, ex);

            retCmd.PostProcessResponse = (cmd, resp, ctx) =>
            {
                return(Task.Factory.StartNew(() => HttpResponseParsers.ReadAccountProperties(resp)));
            };

            requestOptions.ApplyToStorageCommand(retCmd);
            return(retCmd);
        }
 /// <summary>
 /// Reads account properties from an HttpResponseHeaders object.
 /// </summary>
 /// <param name="response">The HttpResponseHeaders from which to read the account properties.</param>
 /// <returns>The account properties stored in the header.</returns>
 public static AccountProperties ReadAccountProperties(HttpResponseMessage response)
 {
     return(HttpResponseParsers.ReadAccountProperties(response));
 }