Currently StackExchange.Utils.Http has dependency on Jil for Json serialization and deserialization.
This package allows to use System.Text.Json instead of JIL
var result = await Http.Request("https://example.com")
.SendSystemTextJson(new { name = "my thing" })
.ExpectSystemTextJson<MyType>(MyJsonSerializerSettings)
.GetAsync()
If serializerSettings is null, JsonSerializer will use default settings from DefaultSettings.
Of course, you can use all other features from StackExchange, like this:
var result = await Http.Request("https://example.com")
.IgnoredResponseStatuses(HttpStatusCode.NotFound)
.WithTimeout(TimeSpan.FromSeconds(20))
.SendSystemTextJson(new { name = "my thing" })
.ExpectSystemTextJson<MyType>()
.GetAsync();