I’m using the webclient to upload values in a post-request here:
using (var client = new WebClient())
{
client.Encoding = Encoding.UTF32;
var parameters = new NameValueCollection
{
{"facebookID", IngamableCommunicator.FacebookProfileID + ""},
{"name", name},
{"content", File.ReadAllText(mapPath)}
};
client.UploadValues(url, parameters);
}
As you can clearly see, I think this is how to change the request content encoding to UTF32. Am I right? Because apparently, it’s not working as expected.
WebClient.EncodingProperty Remark:The
UploadStringandUploadStringAsyncmethods use this property to convert the specified string to a Byte array before uploading the string. For additional information, see theGetBytesmethod.When a string is downloaded using the
DownloadStringorDownloadStringAsyncmethods, WebClient uses the Encoding returned by this to convert the downloaded Byte array into a string. For additional information, see theGetStringmethod.But nothing about encoding in
UploadValues…