Repository navigation
Flurl.Http 2.0
·
535 commits
to master
since this release
This is big. See #205 for details and motivations.
New Features
- Aggressive reuse of
HttpClient(single instance per host) by default when not managing FlurlClient explicitly (#144) IFlurlClientFactoryandFlurlClientFactoryBaseallow for easily customizing caching/reuse strategy- Better IoC support with alternative
IFlurlClientFactoryimplementation (#226) ConnectionLeaseTimeoutsetting to deal with potential DNS issue (#222)- New
FlurlRequestobject implicitly created instead ofFlurlClientin fluent expressions Headersavailable at both request and client level (#157)- URL builder methods and request configuration methods (
WithHeaders, etc) can be called in any order in fluent expressions (#211) FlurlClient.Requestmethod for fluently building a request off a client (#211)FlurlClient.BaseUrlproperty to (optionally) build all requests off of (#211)WithTimeoutspecific to a single requestSettingsavailable onFlurlRequest,FlurlClient,HttpTest, andFlurlHttp(global) level, each inheriting defaults from a level up (#205 (comment))- Ability to fluently tweak request from
BeforeCall/BeforeCallAsync(#213) - More robust
FlurlHttpException.Message(#217) - New
HttpTestassertions:WithHeader/WithoutHeader(#223)
Breaking Changes from 1.x
- All fluent extension methods on
IFlurlClientmoved toIFlurRequest, and all fluent extension methods onUrlandstringthat previously returnedIFlurlClientnow returnIFlurlRequest(Typical usages shouldn't break, but custom extensions should be updated to follow this new pattern) FlurlClient.Urlremoved (superseded byFlurlRequest.Url)FlurlClient.WithUrlremoved (superseded byFlurlClient.Request)FlurlClient.ConfigureClientrenamed toFlurlClient.ConfigureConfigureClientextensions onIFlurlRequest,Url, andstringreplaced byConfigureRequestUrl.ConfigureHttpClientremovedFlurlHttpSettings.DefaultTimeoutreplaced byFlurlHttpSettings.Timeout(like other settings, it's the "default" when defined at client or global level)FlurlClient.Cloneremoved- Several
FlurlClientconstructors removed FlurlHttpSettings.CloneremovedFlurlHttpSettings.AutoDisposeremoved (auto-dispose behavior no longer supported because short-lived clients is not a recommended practice)IHttpClientFactory.CreateClientno longer takes aUrlarg (more relevant toIFlurlClientFactory.Get, where caching strategy should be defined)HttpCall.Urlremoved (superseded byHttpCall.FlurlRequest.UrlHttpCall.Settingsremoved (superseded byHttpCall.FlurlRequest.SettingsWithHeaders(object)converts underscores in property names to hyphens in header names by default (#44)