skip to Main Content

Asp.net – Polly Retry with HTTP Client is exceeding the Number of Max Retries and continues Retry till HTTP Timeout Occurred

I have defined some Typed API Client via Dependency Injection in Start up like below. public void ConfigureHttpClients(IServiceCollection services) { services.AddHttpClient<IMyHttpClient,MyHttpClient>() .AddPolicyHandler(GetRetryPolicy(Configuration)); } And Get Retry Policy is defined like this : private static IAsyncPolicy<HttpResponseMessage> GetRetryPolicy(IConfiguration configuration) { int numberOfretries…

VIEW QUESTION

How to return plain string as JSON in ASP.NET Core 7

In process of migrating from .net framework and are struggling with a difference of response serialization. Everything here seems to indicate that by default a response will go out via the json serializer. https://learn.microsoft.com/en-us/aspnet/core/web-api/advanced/formatting?view=aspnetcore-5.0 but when returning a simple string…

VIEW QUESTION
Back To Top
Search