.NET 4.6.2 "Value cannot be null" exception at WebRequest.GetResponse()
<p>When I run the following code on .NET 4.6.2,</p>

<pre><code>var req = WebRequest.Create("https://fcm.googleapis.com/fcm/send");
req.Method = "POST";
req.ContentType = "application/json";
req.Headers.Add("Authorization", "key=my real key is here");

string json = "{\r\n  \"to\": \"/topics/news\",\r\n  \"data\": {\r\n    \"item0\": \"0\",\r\n    \"item1\": \"1\"\r\n  }\r\n}";
var jsonbytes = Encoding.UTF8.GetBytes(json);

var reqStr = req.GetRequestStream();
reqStr.Write(jsonbytes, 0, jsonbytes.Length);
reqStr.Close();

var res = (HttpWebResponse)req.GetResponse();
Debug.WriteLine(res.StatusCode);
var sr = new StreamReader(res.GetResponseStream());
Debug.Write(sr.ReadToEnd());
sr.Close();
</code></pre>

<p>the following exception occurs at <code>var res = (HttpWebResponse)req.GetResponse();</code>.</p>

<pre><code>Exception   Exception thrown: 'System.ArgumentNullException' in mscorlib.dll ("Value cannot be null.")  System.ArgumentNullException
</code></pre>

<p>I could not get any more information. I do not know what value is null. I ran the same code on .NET 4.5.2, that exception did not occur. Why does this exception occur?</p>