예제 #1
0
        public void TestBodyIsEmptyWithSingleItemQueryString()
        {
            provider.SetParameters(new { });
            StreamReader r       = new StreamReader(provider.GetBody());
            String       content = r.ReadToEnd();

            Assert.AreEqual("", content);
        }
예제 #2
0
        public RequestBuilder Upload(NamedFileStream[] files, object parameters, Action<long,long?> onProgressChanged, Action<long> onUploadComplete)
        {
            MultipartBodyProvider bodyProvider = new MultipartBodyProvider();
            bodyProvider.OnCompletedCallback = onUploadComplete;
            bodyProvider.OnProgressChangeCallback = onProgressChanged;
            foreach (NamedFileStream file in files)
            {
                bodyProvider.AddFile(file);
            }

            bodyProvider.SetParameters(parameters);
            return this.Body(bodyProvider);
        }
예제 #3
0
        public RequestBuilder Upload(NamedFileStream[] files, object parameters, Action <long, long?> onProgressChanged, Action <long> onUploadComplete)
        {
            MultipartBodyProvider bodyProvider = new MultipartBodyProvider();

            bodyProvider.OnCompletedCallback      = onUploadComplete;
            bodyProvider.OnProgressChangeCallback = onProgressChanged;
            foreach (NamedFileStream file in files)
            {
                bodyProvider.AddFile(file);
            }

            bodyProvider.SetParameters(parameters);
            return(this.Body(bodyProvider));
        }