Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lecaillon authored Jun 6, 2019
1 parent 791d29e commit a5597fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Install-Package Cassette.Http
```

### Requirement
- **.NET Core 2+** or **.NET 4.6.1+** since Cassette targets .NET Standard 2.0
- A registered implementation of `IDistributedCache` because the `ReplayingHandler` has a dependency on it.
- **.NET Core 2+** or **.NET 4.6.1+**
- Register an implementation (Redis, SQL Server, in-memory) of [`IDistributedCache`](https://docs.microsoft.com/en-us/aspnet/core/performance/caching/distributed).

### Usage
Most of the time Cassette will have to be configured both in your application as well as in the associated test project.

#### In the application
The easiest way to configure Cassette is to use the [HttpClientFactory](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests). It will allow you to add the `ReplayingHandler` to every `HttpClient`. A sample that also uses [Refit](https://github.com/reactiveui/refit) is available [here](https://github.com/lecaillon/Cassette/blob/7b2b95c42624dc0a21b1e6968aa01a106bc35ea2/samples/AspNetCore.HttpClientFactory.QuickStart/Startup.cs#L24).
The easiest way to configure Cassette is to use the [HttpClientFactory](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests). It will allow you to add the `ReplayingHandler` to every `HttpClient`. A sample that also uses [Refit](https://github.com/reactiveui/refit) is available [here](https://github.com/lecaillon/Cassette/blob/master/samples/AspNetCore.HttpClientFactory.QuickStart/Startup.cs).
> Until the `AddCassette()` configuration method has been called, the HTTP message handler is not really added to the HttpClient, so its behavior remains unchanged.
```c#
services.AddRefitClient<IGeoApi>()
Expand Down

0 comments on commit a5597fe

Please sign in to comment.