Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for the Http.Resilience RemoveAllResilienceHandlers method #45335

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rainsxng
Copy link

@rainsxng rainsxng commented Mar 13, 2025

Summary

Describe your changes here.

Fixes #Issue_Number (if available)


Internal previews

📄 File 🔗 Preview link
docs/core/resilience/http-resilience.md docs/core/resilience/http-resilience

@@ -77,6 +77,19 @@ Given that you've created an <xref:Microsoft.Extensions.DependencyInjection.IHtt

The preceding code adds the standard resilience handler to the <xref:System.Net.Http.HttpClient>. Like most resilience APIs, there are overloads that allow you to customize the default options and applied resilience strategies.

## Remove standard resilience handler

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, please, add some intro? Something like this:

"We provide a method xref:RemoveAllResilienceHandlers which removes all previously registered resilience handlers. It is useful when you need to clear all existing resilience handlers and add your custom one."

The preceding code:

- Adds the standard resilience handler to the named <xref:System.Net.Http.HttpClient> instance
- Removes all predefined resilience handlers that were previously registered. This is useful when you want to start with a clean slate and add your own custom strategies.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Removes all predefined resilience handlers that were previously registered. This is useful when you want to start with a clean slate and add your own custom strategies.
- Removes all predefined resilience handlers that were previously registered. This is useful when you want to start with a clean state and add your own custom strategies.


- Adds the standard resilience handler to the named <xref:System.Net.Http.HttpClient> instance
- Removes all predefined resilience handlers that were previously registered. This is useful when you want to start with a clean slate and add your own custom strategies.
- Adds a `StandardHedgingHandler` to the <xref:System.Net.Http.HttpClient>.You can replace `AddStandardHedgingHandler()` with any strategy that suits your application's needs, such as retry mechanisms, circuit breakers, or other resilience techniques.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Adds a `StandardHedgingHandler` to the <xref:System.Net.Http.HttpClient>.You can replace `AddStandardHedgingHandler()` with any strategy that suits your application's needs, such as retry mechanisms, circuit breakers, or other resilience techniques.
- Adds a `StandardHedgingHandler` to the <xref:System.Net.Http.HttpClient>. You can replace `AddStandardHedgingHandler()` with any strategy that suits your application's needs, such as retry mechanisms, circuit breakers, or other resilience techniques.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants