This commit is contained in:
Archi
2021-12-07 21:34:46 +01:00
parent b9108742d4
commit 581d5167b9
2 changed files with 5 additions and 5 deletions

View File

@@ -680,11 +680,11 @@ public sealed class WebBrowser : IDisposable {
requestMessage.Content = content;
break;
case IReadOnlyCollection<KeyValuePair<string?, string?>> nameValueCollection:
case IReadOnlyCollection<KeyValuePair<string, string>> nameValueCollection:
try {
requestMessage.Content = new FormUrlEncodedContent(nameValueCollection);
} catch (UriFormatException) {
requestMessage.Content = new StringContent(string.Join("&", nameValueCollection.Select(static kv => $"{WebUtility.UrlEncode(kv.Key)}={WebUtility.UrlEncode(kv.Value)}")), null, "application/x-www-form-urlencoded");
requestMessage.Content = new StringContent(string.Join("&", nameValueCollection.Select(static kv => $"{Uri.EscapeDataString(kv.Key)}={Uri.EscapeDataString(kv.Value)}")), null, "application/x-www-form-urlencoded");
}
break;