Currently StackExchange.Utils.Http has dependency on Jil for Json serialization and deserialization.
This package allows to use NewtonSoft Json.NET instead of JIL
var result = await Http.Request("https://example.com")
.SendNewtonJson(new { name = "my thing" })
.ExpectNewtonJson<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))
.SendNewtonJson(new { name = "my thing" })
.ExpectNewtonJson<MyType>()
.GetAsync();