public void TestBodyIsEmptyWithSingleItemQueryString() { provider.SetParameters(new { }); StreamReader r = new StreamReader(provider.GetBody()); String content = r.ReadToEnd(); Assert.AreEqual("", content); }
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); }
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)); }