示例#1
0
        public async Task DownloadFtpRfcViaFtpRequester()
        {
            var url       = "ftp://ftp.funet.fi/pub/standards/RFC/rfc959.txt";
            var requester = new FtpRequester();
            var request   = new Request {
                Address = Url.Create(url)
            };

            var response = await requester.RequestAsync(request, CancellationToken.None);

            Assert.IsNotNull(response);

            var content = await new StreamReader(response.Content).ReadToEndAsync();

            Assert.AreEqual(147316, content.Length);
        }
        public async Task DownloadFtpRfcViaFtpRequester()
        {
            var url       = "ftp://ftp.funet.fi/pub/standards/w3/TR/2003/xhtml2-20030506/attributes.html";
            var requester = new FtpRequester();
            var request   = new Request {
                Address = Url.Create(url)
            };

            var response = await requester.RequestAsync(request, CancellationToken.None);

            Assert.IsNotNull(response);

            var content = await new StreamReader(response.Content).ReadToEndAsync();

            Assert.AreEqual(1245, content.Length);
        }