This project is read-only.

Reading MultipartContent

Topics: Web Api
Apr 18, 2011 at 4:03 PM

I'm playing with MultipartContent, but so far have no success with content
"round tripping", possibly due to a bug.

Keep up the work, love the API so far.

var content = new MultipartContent("Mixed", Guid.NewGuid().ToString("N"));
content.Add(new StringContent("One"));
content.Add(new StringContent("Two"));

var mem = new MemoryStream();

var content2 = new MultipartContent();
mem.CopyTo(content2.ContentReadStream); // <-- is this how it's supposed to?
// --->FAIL

Debug.Assert(content2.Count() == 2);