Revert "FormUrlEncodedContent - make key non Nullable (#40267)" (#40711)
authorMarie Píchová <11718369+ManickaP@users.noreply.github.com>
Wed, 12 Aug 2020 16:17:10 +0000 (18:17 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Aug 2020 16:17:10 +0000 (18:17 +0200)
This reverts commit b977407c9ec8cd7f87ea9bbab8fb69ad45a747e1.

Co-authored-by: Jan Jahoda <jajahoda@microsoft.com>
src/libraries/System.Net.Http/src/System/Net/Http/FormUrlEncodedContent.cs

index 0b684b1..fe723de 100644 (file)
@@ -12,13 +12,13 @@ namespace System.Net.Http
 {
     public class FormUrlEncodedContent : ByteArrayContent
     {
-        public FormUrlEncodedContent(IEnumerable<KeyValuePair<string, string?>> nameValueCollection)
+        public FormUrlEncodedContent(IEnumerable<KeyValuePair<string?, string?>> nameValueCollection)
             : base(GetContentByteArray(nameValueCollection))
         {
             Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
         }
 
-        private static byte[] GetContentByteArray(IEnumerable<KeyValuePair<string, string?>> nameValueCollection)
+        private static byte[] GetContentByteArray(IEnumerable<KeyValuePair<string?, string?>> nameValueCollection)
         {
             if (nameValueCollection == null)
             {
@@ -27,7 +27,7 @@ namespace System.Net.Http
 
             // Encode and concatenate data
             StringBuilder builder = new StringBuilder();
-            foreach (KeyValuePair<string, string?> pair in nameValueCollection)
+            foreach (KeyValuePair<string?, string?> pair in nameValueCollection)
             {
                 if (builder.Length > 0)
                 {