The following code throws an exception ONLY on iOS - on Android it works as expected:
var content = new StringContent(
JsonSerializer.Serialize(new { UserName = userName, Password = password }), Encoding.UTF8, "application/json");
I saw the article at https://learn.microsoft.com/en-us/answers/questions/302548/jsonserializer-throws-exception-in-xamarinios.html but that solution did not solve my issue.
Any ideas? Or do I go back to Newtonsoft?