/// <summary>
        /// Constructs a web request to use to acquire, renew, release or break the lease for the blob.
        /// </summary>
        /// <param name="uri">The absolute URI to the blob.</param>
        /// <param name="timeout">The server timeout interval.</param>
        /// <param name="action">The lease action to perform.</param>
        /// <param name="leaseId">The lease ID.</param>
        /// <returns>A web request to use to perform the operation.</returns>
        public static HttpWebRequest Lease(Uri uri, int timeout, LeaseAction action, string leaseId)
        {
            UriQueryBuilder builder = new UriQueryBuilder();

            builder.Add(Constants.QueryConstants.Component, "lease");

            HttpWebRequest request = CreateWebRequest(uri, timeout, builder);

            request.ContentLength = 0;
            request.Method        = "PUT";

            Request.AddLeaseId(request, leaseId);

            // acquire, renew, release, or break; required
            request.Headers.Add("x-ms-lease-action", action.ToString());

            return(request);
        }
 /// <summary>
 /// Adds a lease action to a request.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <param name="leaseAction">The lease action.</param>
 internal static void AddLeaseAction(HttpRequestMessage request, LeaseAction leaseAction)
 {
     request.Headers.Add(Constants.HeaderConstants.LeaseActionHeader, leaseAction.ToString().ToLower());
 }
        /// <summary>
        /// Constructs a web request to use to acquire, renew, release or break the lease for the blob.
        /// </summary>
        /// <param name="uri">The absolute URI to the blob.</param>
        /// <param name="timeout">The server timeout interval.</param>
        /// <param name="action">The lease action to perform.</param>
        /// <param name="leaseId">The lease ID.</param>
        /// <returns>A web request to use to perform the operation.</returns>
        public static HttpWebRequest Lease(Uri uri, int timeout, LeaseAction action, string leaseId)
        {
            UriQueryBuilder builder = new UriQueryBuilder();
            builder.Add(Constants.QueryConstants.Component, "lease");

            HttpWebRequest request = CreateWebRequest(uri, timeout, builder);

            request.ContentLength = 0;
            request.Method = "PUT";

            Request.AddLeaseId(request, leaseId);

            // acquire, renew, release, or break; required
            request.Headers.Add("x-ms-lease-action", action.ToString());

            return request;
        }
 /// <summary>
 /// Adds a lease action to a request.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <param name="leaseAction">The lease action.</param>
 internal static void AddLeaseAction(HttpWebRequest request, LeaseAction leaseAction)
 {
     request.Headers.Add(Constants.HeaderConstants.LeaseActionHeader, leaseAction.ToString().ToLower());
 }
 /// <summary>
 /// Adds a lease action to a request.
 /// </summary>
 /// <param name="request">The request.</param>
 /// <param name="leaseAction">The lease action.</param>
 internal static void AddLeaseAction(StorageRequestMessage request, LeaseAction leaseAction)
 {
     request.Headers.Add(Constants.HeaderConstants.LeaseActionHeader, leaseAction.ToString().ToLower());
 }