I am creating a cross-platform library using the .NET core class library project template and need to communicate with a REST service using JSON.
I can't use the JSON.NET Nuget package or "System.Runtime.Serialization.Json" because neither of these packages support .netcore.
For legacy reasons as well as netstandard1.2 I am also targeting net40.
You can use Newtonsoft.Json.
Alternatively, you could write metadata for it in the Swagger format and use AutoRest to automatically generate a proxy class for you. Internally the generated code from AutoRest uses Newtonsoft.Json for json serialization.