I am writing a C# api client and for most of the post requests I used FormUrlEncodedContent to post the data.
List<KeyValuePair<string, string>> keyValues = new List<KeyValuePair<string, string>>();
keyValues.Add(new KeyValuePair<string, string>("email", email));
keyValues.Add(new KeyValuePair<string, string>("password", password));
var content = new FormUrlEncodedContent(keyValues);
But now I need to post a string array as one parameter. Some thing like below.
string[] arr2 = { "dir1", "dir2"};
How can I send this array along with other string parameters using c# HttpClient.
List<KeyValuePair<string, string>>
instead of a Dictionary<string, string>? – Posture