New
Flurl.Http 4.0.0
This is a significant release with many breaking changes. Please read carefully. An upgrade guide has also been added to the documentation.
Big stuff, all BREAKING:
- Removed dependency on
Newtonsoft.Jsonin favor ofSystem.Text.Json(#517)- Rather stick with Newtonsoft? Try the new Flurl.Http.Newtonsoft companion package
- Removed all non-generic,
dynamic-returning JSON methods (#699)- Flurl.Http.Newtonsoft also brings these back.
- Huge overhaul of Flurl's configuration system to make it more fluent and more DI-friendly (#770)
- "Factories" are removed, replaced by fluent configuration of HttpClient and HttpMessageHandlers
FlurlHttpstatic object completely overhauled, now mostly just responsible for client caching associated with "clientless" usage patternConfigureandConfigureRequestmethods renamed toWithSettings
- Overhaul of Event Handlers (#784)
- No longer available on
Settings - Fluent extension methods still work
- No longer available on
Smaller stuff, all BREAKING:
Settings.ConnectionLeaseTimeoutremoved (#703)WithClientextension methods removed (#590)CancellationTokenmoved to last arg everywhere that it isn't (#702)AllowHttpStatusnow takesintinstead ofHttpStatusCodeargs (#785)GetStreamAsyncdefaults to unbuffered behavior (#630)IFlurlClient.SettingsandIFlurlRequest.Settingscontainer objects are read-onlyIFlurlClient.HttpMessageHandlerremovedFlurlCall.RedirectedFrommoved toIFlurlRequest(accessible viaFlurlCall.Request.RedirectedFrom)FlurlResponsector takes aFlurlCallinstead of anHttpResponseMessageFlurlRequest.Clientis no longer instantiated on demand by just referencing the property. If it hasn't been set explicitly, or (more common) by callingFlurlClient.Request, it will remain null until the request is sentIHttpSettingsContainerrenamed toISettingsContainer, and itsHeadersproperty moved to (new)IHeadersContainer(#773)FakeHttpMessageHandler,TestHttpClientFactory, andTestFlurlHttpSettingstypes all removed
Non-breaking enhancements and bug fixes:
- First-class support for persisting and restoring
CookieJar(#758) - HTTP 2.0 support via
Settings.HttpVersion(#639) AllowRealHttpnow reverts to original HttpClient, eliminating certain quirks (#683)- Flurl no longer disposes request message automatically, per best practices (#650)
- Removed circular redirect detection (#714)
- Bugfix:
ShouldHaveCalledfalse negative with URL ending with?(#721) - Bugfix: extra space added to Content-Type headers (#740)