Ejemplo n.º 1
0
        public static HttpWebRequest CreateShareRequest(FileContext context, string shareName)
        {
            Uri uri = FileClientTests.ConstructUri(context.Address, shareName);
            OperationContext opContext = new OperationContext();
            HttpWebRequest   request   = ShareHttpWebRequestFactory.Create(uri, context.Timeout, true, opContext);

            Assert.IsNotNull(request);
            Assert.IsNotNull(request.Method);
            Assert.AreEqual("PUT", request.Method);
            FileTestUtils.RangeHeader(request, null);
            FileTestUtils.VersionHeader(request, false);
            return(request);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructs a web request to create a new share.
 /// </summary>
 /// <param name="uri">The absolute URI to the share.</param>
 /// <param name="timeout">The server timeout interval.</param>
 /// <param name="useVersionHeader">A boolean value indicating whether to set the <i>x-ms-version</i> HTTP header.</param>
 /// <param name="operationContext">An <see cref="OperationContext" /> object for tracking the current operation.</param>
 /// <returns>A web request to use to perform the operation.</returns>
 public static HttpWebRequest Create(Uri uri, int?timeout, bool useVersionHeader, OperationContext operationContext)
 {
     return(ShareHttpWebRequestFactory.Create(uri, null /* properties */, timeout, useVersionHeader, operationContext));
 }