github tmenier/Flurl Flurl.Http.3.0.0-pre4
Flurl.Http 3.0

[Features to be pre-released incrementally. Will update here.]

New Features

  • FlurlResponse introduced, primarily to enable inspecting response and deserializing body in separate steps (#354)
  • Major overhaul of cookie functionality (#506)
  • Overhaul of redirect handling (#500)
  • Tests can be set up to return different fake responses depending on the URL or any other request conditions (#481)
  • HttpTest.ForCallsTo(...).AllowRealHttp() for allowing real calls to be made in a test for specific URLs or any other request conditions (#225)
  • New/more complete set of test assertions for headers and cookies. (#508)
  • All extension methods on Flurl.Url and string are now also available on System.Uri (#489)

Breaking Changes from 2.x

  • Fluent methods that previously returned HttpResponseMessage (such GetAsync, PostAsync, etc) now return FlurlResponse. If you're using GetJsonAsync or chaining ReceiveXXX methods, this shouldn't break anything (#354)
  • HttpCall is now FlurlCall, and several properties of FlurlCall and FlurlHttpException were moved or renamed (#488)
  • CookiesEnabled removed at all settings levels. (#506)
  • Cookies, WithCookie and WithCookies removed from IFlurlClient (Use CookieSession instead. #506)
  • IFlurlRequest.Cookies is now read-only IEnumerable<(string Name, string Value)>. (Use WithCookies instead. #506)
  • Cookie request header and Set-Cookie response headers are always visible in Headers collection of request and response. (#506)
  • IFlurlRequest.Headers and IFlurlClient.Headers are now INameValueList<object>. (#541)
  • When asserting a specific URL was called, it must be a full string match rather than "contains" or "starts with". Add a * wildcard to the beginning or end if you need partial match behavior (#323)
  • When faking responses in tests, the last response in the queue becomes "sticky" rather than falling back to empty 200 responses (#482)
  • HttpTest.ResponseQueue public property has been removed. Underlying queue implementation changed significantly to support new features, and hopefully accessing it directly isn't needed. Use RespondWith methods to build the queues.
  • Slightly different rules on when a redirect causes the verb to change to GET. (Never on 300, always on 303. #500)
  • Default HttpHandlerHandler disables UseCookies and AllowAutoRedirect. Any custom factory-provided handler must do the same if Flurl's new cookie and redirect features are needed. (#500 & #506)

Bug Fixes

  • In tests, dequeuing fake responses is fully thread-safe (#366)
latest releases: Flurl.Http.3.2.0, Flurl.Http.3.1.0, Flurl.3.0.2...
10 months ago