Skip to content

Releases: tmenier/Flurl

Flurl.Http 3.0

09 Nov 16:38
Compare
Choose a tag to compare

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)
  • Providing a body for PostAsync, PutAsync, and PatchAsync now optional. (#515)

Breaking Changes from 2.x

Making HTTP calls

  • 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)
  • Slightly different rules on when a redirect causes the verb to change to GET. (Never on 300, always on 303. #500)
  • Minor changes to CapturedStringContent constructors. (#452)

Headers

  • New collection type for IFlurlRequest.Headers and IFlurlClient.Headers. (#541)
  • HttpRequestMessage.GetHeaderValue and HttpResponseMessage.GetHeaderValue extension methods removed. (#553)
  • For multipart requests, Content-Type header for text parts allowed but not defaulted. (#452)
  • Cookie request header and Set-Cookie response headers are always visible in Headers collection of request and response. (#506)

Cookies

  • 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)

Testing

  • 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.
  • Minor changes/enhancements to HttpCallAssertion. (#483)

Other

  • UseCookies and AllowAutoRedirect are disabled on the default HttpClientHandler . Any custom factory-provided handler must do the same if Flurl's new cookie and redirect features are required. (#500 & #506)
  • Default HttpClient caching strategy based on host, scheme, and port, rather than just host. (#550)
  • Dropping support for older platforms. (#544)

Bug Fixes

  • In tests, dequeuing fake responses is fully thread-safe. (#366)
  • Culture-neutral string comparisons throughout library. (#485)

Flurl 3.0

13 Sep 14:59
Compare
Choose a tag to compare

Flurl 3.0 contains a major rewrite of the URL building/parsing engine. It brings Flurl.Url's feature set more in line with System.Uri, while also addressing some of its quirks.

New Features

  • New Url properties (#440)

    • Scheme (read/write)
    • UserInfo (read/write)
    • Host (read/write)
    • Port (read/write)
    • Authority (read-only, UserInfo + Host + Port)
    • Root (read-only, Scheme + Authority)
    • PathSegments (modifiable)
    • IsRelative (read-only)
    • IsSecureScheme (read-only, true for https or wss)
  • All URL-building extension methods currently on string now available on System.Uri (#489)

  • New fluent builder methods on Flurl.Url, System.Uri, and string:

    • RemovePathSegment() (removes the last segment)
    • RemovePath()
    • RemoveQuery()
    • Reset() (restores Url to its original state as constructed, NOT available on string)
  • Support for relative URLs (#407)

  • Parameterless constructor for Url (#518)

  • New static utility method: Url.ParsePathSegments(string) (assumes entire string is the path portion of a URL)

Breaking Changes from 2.x

  • New collection type for Url.QueryParams (#555)
  • Url.Path changed to be more in line with the formal definition. Previously it included everything (scheme, host, etc.) up to the query string. It now starts after the host/port, including the leading / if present.
  • Url.IsValid() instance method was removed. It was confusing in the case of relative URLs since arguably any string could be considered a valid relative URL. Check the IsRelative property instead. (Static Url.IsValid(string) method is still available but, same a before, returns true only for valid absolute URLs.)
  • Dropping support for older platforms (#544)

Bug fixes:

  • Url.ToUri() now works for relative URLs (#407)

Flurl.Http 2.4.2

28 Apr 17:11
Compare
Choose a tag to compare
  • Updated package dependencies

Flurl 2.8.2

28 Apr 15:57
Compare
Choose a tag to compare
  • Bug when decoding encoded + (#437)

Flurl.Http 2.4.1

15 Feb 03:22
Compare
Choose a tag to compare
  • Multipart enhancement: allow alternate filename when adding file based on local path (#402)
  • Improvements to downloaded file name inference (#404)
  • Ensure FlurlClientFactory.Get is only called once when sending request (#374)
  • BUGFIX: Plugged memory leak by disposing CancellationTokenSource (#395)
  • BUGFIX: Prevent adding Content-Type header to multipart strings (#392)
  • BUGFIX: Missed a few cases when setting headers at request vs content level (#405)

Flurl 2.8.1

15 Feb 02:18
Compare
Choose a tag to compare
  • Added Url.Clone method (#420)
  • Added Url ctor that takes a Uri (#406)
  • BUGFIX: Skip write-only props when converting objects to kv pairs (#373)

Flurl.Http 2.4.0

31 Aug 18:10
7be75ef
Compare
Choose a tag to compare
  • Improved ConnectionLeaseTimeout implementation (#330)
  • Consistent disposal of HttpResponseMessage (#329)
  • Added ConfigureClient method to IFlurlClientFactory (#356)
  • Added optional CancelationToken to DownloadFileAsync (#360)
  • Added WithRequestUrlEncoded method to HttpCallAssertion (#347)
  • Upgraded dependencies to latest Flurl & Newtonsoft

Flurl 2.8.0

22 Jul 21:28
Compare
Choose a tag to compare
  • Overridden Url.Equals method (#337)
  • Url.ToUri() method (#339)

Flurl.Http 2.3.2

03 Jul 16:21
582113e
Compare
Choose a tag to compare
  • Header normalization and underscore logic used in core HTTP methods now also used in HttpTest header methods. (#331)
  • New extension methods SetHeader and GetHeaderValue on HttpRequestMessage and HttpResponseMessage, allowing you to read/write headers without caring whether they're at the message level or HttpContent level. (#331)
  • Use AsyncLocal to store HttpTest.Current in .NET Framework 4.6+ (#325)
  • BUGFIX: NullReferenceException when disposing FlurlClient constructed with existing HttpClient. (#334)
  • BUGFIX: NullReferenceException when setting a content-type header but not actually sending content. (#313)
  • BUGFIX: Calls made with FlurlClient.HttpClient result in null entries in HttpTest's call log, causing errors. (#335)
  • Better comments on methods that serialize POCOs to JSON. (#312)

Flurl.Http 2.3.1

17 Apr 01:58
6b90df0
Compare
Choose a tag to compare
  • First-class support for OPTIONS requests via OptionsAsync (#220)
  • Support building & testing on Mac and Linux (#290 & #286, thx @nlowe )
  • FlurlClient constructor for wrapping an existing HttpClient (#298)
  • Public constructor for HttpCall so that fakes can be easily created (#304)
  • BREAKING: IFlurlClientFactory implements IDisposable (#309)
  • BUGFIX: Don't overwrite content headers when set explicitly (#256)
  • BUGFIX: WithHeader assert failed when header had space (#307)