Example #1
0
        public async Task Test10163(TestContext ctx, HttpServer server,
                                    [AuthenticationType] AuthenticationType authType,
                                    CancellationToken cancellationToken)
        {
            var post = new PostHandler("Post bug #10163", HttpContent.HelloWorld);

            var handler = CreateAuthMaybeNone(post, authType);

            var uri = handler.RegisterRequest(server);

            using (var client = new WebClient()) {
                ConfigureWebClient(client, handler, cancellationToken);

                var stream = await client.OpenWriteTaskAsync(uri, "PUT");

                using (var writer = new StreamWriter(stream)) {
                    await post.Content.WriteToAsync(writer);
                }
            }
        }
Example #2
0
 protected override Task<Stream> OpenWriteAsync(WebClient wc, string address) => wc.OpenWriteTaskAsync(address);
Example #3
0
 protected override Task <Stream> OpenWriteAsync(WebClient wc, string address) => wc.OpenWriteTaskAsync(address);
 public static Task <Stream> OpenWriteTaskAsync(this WebClient webClient, string address, string method)
 {
     return(webClient.OpenWriteTaskAsync(webClient.GetUri(address), method));
 }
 public static Task <Stream> OpenWriteTaskAsync(this WebClient webClient, Uri address)
 {
     return(webClient.OpenWriteTaskAsync(address, null));
 }