Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Closed Issue: MultipartFormDataContent treatment of nested FormUrlEncodedContent [181]

$
0
0
Given a set of key-value pairs, I would expect these two pieces of code to produce a similar result, they do not:

var content = new MultipartFormDataContent();
var values = new[] { new KeyValuePair<string, string>("Foo", "Bar"), };
content.Add(new FormUrlEncodedContent(values));

vs. this:

var content = new MultipartFormDataContent();
var values = new[] { new KeyValuePair<string, string>("Foo", "Bar"), };
foreach (var keyValuePair in values)
{
content.Add(new StringContent(keyValuePair.Value), keyValuePair.Key);
}

The latter creates the same request structure a browser form would. The former does not.
Comments: The original issue was by design. And the second suggestion is on a class that this project does not own. We will communicate this suggestion to the right team.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>