I am trying to use HttpClient's PostAsync to login to a website; However it always fails and when I tracked the connection using WireShark I found that it posts the data incorrectly
Code
var content = new FormUrlEncodedContent(new[]
{
new KeyValuePair<string, string>("value1", data1),
new KeyValuePair<string, string>("value2", data2),
new KeyValuePair<string, string>("value3", data3)
});
or
var content = new List<KeyValuePair<string, string>>
{
new KeyValuePair<string, string>("value1", data1),
new KeyValuePair<string, string>("value2", data2),
new KeyValuePair<string, string>("value3", data3)
};
usage
httpClient.PostAsync(postUri, content)
Expectations
value1=123456&value2=123456&value3=123456
Reality
//It adds strange += which makes the post fail...
value1=123456&value2+=123456&value3+=123456