HttpResponseMessage.Content is non-nullable in NET5
Today I was happily migrating some C# projects to Net 5 when I stumbled upon something unexpected. My focus was on a library (a NetStandard2.0 REST API client, an SDK) and its associated test suite. The test project was a NetCore 3.1 application. As you can imagine, being a REST API client, the library does a lot of talking with a remote Web Service. It does that by leveraging the almightly System.Net.HttpClient. The library has a private, static HttpResponseMessage parser method. Its job is, well, to parse all responses from the remote. It looks for known, expected headers, gracefully handle them, and then deserializes the response content, if there is any. ...