A Newtonsoft-based JSON serializer for Flurl.Http 4.0 and above.
$ dotnet add package Flurl.Http.NewtonsoftFlurl.Http 4.0 removed the Newtonsoft.Json dependency in favor of System.Text.Json for its default JSON serializer implementation. This has several advantages, most notably that it dramatically reduces Flurl's footprint, which is especially important to developers using it in mobile apps and browser platforms.
But it's also a breaking change. Upgrading from 3.x may cause some pains, such as:
dynamics has also been removed in Flurl, specifically due to the lack of support in STJ.This package aims to solve these problems, making upgrading easier for those who still want or need Newtonsoft-based serialization. Included in this package:
NewtonsoftJsonSearializer, an instance of which can be assigned to a Flurl client or request via Settings.JsonSerializer.FlurlHttp.Clients.UseNewtonsoft()new FlurlClientCache().UseNewtonsoft()dynamic-returning GetJson, GetJsonList, ReceiveJson, and ReceiveJsonList extension methods.Both NewtonsoftJsonSerializer and the UseNewtonsoft shortcuts take an optional JsonSerializerSettings parameter. In fact, the serializer was lifted directly from 3.x, so you can trust that it's battle-tested and highly performant.