Skip to content

Releases: justeattakeaway/httpclient-interception

JustEat.HttpClientInterception v3.0.0

11 Oct 08:27
Compare
Choose a tag to compare

Added

  • Add support for async custom matching. (#130)
  • Improve exceptions thrown for missing registrations. (#130)
  • Add net472 as a target framework. (#127)
  • Add support for the new System.Text.Json APIs. (#127)
  • Add netstandard2.1 as a target framework. (#127)
  • Add nullable reference type annotations. (#127)
  • Add support for cancellation tokens to OnIntercepted() (#144) Thanks @slang25!

Changes

  • Add analyzer for public API surface. (#132)
  • Remove Newtonsoft.Json from the public surface area of the API. (#127)
  • Use Microsoft.NETFramework.ReferenceAssemblies to compile .NET Framework versions on non-Windows platforms. (#127)
  • Use C# 8. features. (#127)

Fixes

  • Fix typos in XML documentation. (#127)

Removed

  • Remove support for .NET Standard 1.3. (#127)

Contributors

JustEat.HttpClientInterception v2.0.2

02 Aug 12:23
f864e60
Compare
Choose a tag to compare

Added

  • Add support for matching by request content. (#108)

Changes

  • Use coverlet for code coverage. (#103)

Contributors

JustEat.HttpClientInterception v2.0.1

28 Apr 17:28
584b416
Compare
Choose a tag to compare

Fixes

  • Fixed custom content-type HTTP response headers not being used for HTTP bundles. (#84)

Contributors

JustEat.HttpClientInterception v2.0.0

25 Mar 11:22
da65ff1
Compare
Choose a tag to compare

Added

  • Add support for matching requests to intercept by HTTP request headers. (#57)
  • Add ThrowsOnMissingRegistration() extension method to HttpClientInterceptorOptions. (#57)
  • Add support for configuring requests to intercept using "bundle files" in JSON format. (#72)

Changes

Contributors

JustEat.HttpClientInterception v2.0.0-beta1

17 Mar 09:08
3894821
Compare
Choose a tag to compare

Added

  • Add support for matching requests to intercept by HTTP request headers. (#57)
  • Add ThrowsOnMissingRegistration() extension method to HttpClientInterceptorOptions. (#57)
  • Add support for configuring requests to intercept using "bundle files" in JSON format. (#72)

Changes

Contributors

JustEat.HttpClientInterception v1.2.2

14 Oct 15:21
50264ee
Compare
Choose a tag to compare

Added

  • Add convenience method WithFormContent() for URL-encoded form content. (#32)
  • Added netstandard2.0 target framework. (#34)

Changes

  • Add support for Source Link. (#15, #16, #23)
  • Update tests to use .NET Core 2.1. (#23)
  • Update sample application for ASP.NET Core 2.1. (#23)
  • Update sample code and documentation to show usage with IHttpClientFactory. (#23)
  • Collect memory allocation details in benchmarks. (#23)
  • Add Roslyn source analyzers and fix issues found by them. (#29)
  • Use ConfigureAwait(false) for internal awaits to remove potential for deadlocks if used in a UI application. (#29)
  • Add C#-specific EditorConfig settings. (#35)
  • Remove obsolete MSBuild code. (#39) Thanks @slang25!
  • Add GitHub issue templates. (#40)
  • Various improvements to build scripts, test dependencies and the .NET Core SDK version used.
  • Add assets to allow running the tests from Visual Studio Code.
  • Ignore Rider files in .gitignore. (#51) Thanks @josephwoodward!
  • Fix build on macOS/Linux if build.sh wasn't used. (#51) Thanks @josephwoodward!

Contributors

JustEat.HttpClientInterception v1.2.1

11 Mar 16:30
cfd4f8b
Compare
Choose a tag to compare

Changes

  • Fix handling of default ports when re-using the same HttpRequestInterceptionBuilder instance to register interceptions for different URI schemes. (#25)
  • Update benchmarks to use new syntax introduced in version 1.2.0. (#24)

Contributors

JustEat.HttpClientInterception v1.2.0

07 Mar 14:12
ab741bf
Compare
Choose a tag to compare

Overview

This version adds various changes to make it easier to intercept requests based on arbitrary conditions you provide, as well as to ignore the hostname and/or path for requests.

It also adds some new methods to make the fluent API for HttpRequestInterceptionBuilder easier to use.

Thanks to @stephenthrelfall for raising the issue (#20) that lead to these changes 👍

Below is an example comparing the previous (and still usable) syntax compared to the new syntax options:

1.0.0+

var builder = new HttpRequestInterceptionBuilder()
    .ForHost("public.je-apis.com")
    .ForPath("terms")
    .WithJsonContent(new { Id = 1, Link = "https://www.just-eat.co.uk/privacy-policy" });

var options = new HttpClientInterceptorOptions()
    .Register(builder);

1.2.0+

var options = new HttpClientInterceptorOptions();

var builder = new HttpRequestInterceptionBuilder()
    .Requests()
    .ForHost("public.je-apis.com")
    .ForPath("terms")
    .Responds()
    .WithJsonContent(new { Id = 1, Link = "https://www.just-eat.co.uk/privacy-policy" })
    .RegisterWith(options);

Changes

  • Support arbitrary request matching using the new For(Predicate<HttpRequestMessage>) method on HttpRequestInterceptionBuilder. This also adds a complementary HavingPriority(int?) method that allows multiple different predicates to be registered with a hierarchy. (#21)
  • Add Deregister(HttpRequestInterceptionBuilder) convenience method to HttpClientInterceptorOptions. (#21)
  • Support configuring HttpRequestInterceptionBuilder to ignore the request hostname by using ForAnyHost(). (#20, #21)
  • Support configuring HttpRequestInterceptionBuilder to ignore the request path by using IgnoringPath(). (#21)
  • Add OnMissingRegistration property to HttpClientInterceptorOptions to allow dynamically building a response for any requests that do not match any registered interceptions. (#20, #21)
  • Add RegisterWith(HttpClientInterceptorOptions) extension method to HttpRequestInterceptionBuilder to make it easier to chain multiple registrations fluently. (#21)
  • Add no-op Requests() and Responds() extension methods to HttpRequestInterceptionBuilder which can be used to make fluent usage of the type more expressive in intent. (#21)

Contributors

JustEat.HttpClientInterception v1.1.0

23 Feb 11:17
adfd297
Compare
Choose a tag to compare

Changes

  • Support conditional request interception (#9)
  • Add option to ignore query strings (#10)
  • Add convenience overload methods for registering multiple interceptions at once (#11, #13)
  • Documentation and example improvements (#12, #17)
  • Now tested on OS X as part of our continuous integration (#18)

Contributors

JustEat.HttpClientInterception v1.0.0

02 Oct 09:53
Compare
Choose a tag to compare

First release.

Package available on NuGet.