A .NET Standard library for intercepting server-side HTTP dependencies.
This library provides functionality for intercepting HTTP requests made using the HttpClient
class in code targeting .NET Standard 2.0 (and later), and .NET Framework 4.7.2.
The primary use-case is for providing stub responses for use in tests for applications, such as an ASP.NET Core application, to drive your functional test scenarios.
The library is based around an implementation of DelegatingHandler
, which can either be used directly as an implementation of HttpMessageHandler
, or can be provided to instances of HttpClient
. This also allows it to be registered via Dependency Injection to make it available for use in code under test without the application itself requiring any references to JustEat.HttpClientInterception
or any custom abstractions of HttpClient
.
This design means that no HTTP server needs to be hosted to proxy traffic to/from, so does not consume any additional system resources, such as needing to bind a port for HTTP traffic, making it lightweight to use.
Any feedback or issues for this library can be added to the issues in GitHub.
This package is licensed under the Apache 2.0 license.