Skip to main content

Questions tagged [httpclient]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
2 answers
211 views

How can I design the configuration of the library with Typed HttpClients in DI better?

I have written a .Net Client wrapper for Google Gemini (Generative AI) REST API and published it as a Nuget package. I am seeking a review of the code. I have spent quite some time in designing how it ...
Junaid's user avatar
  • 137
1 vote
1 answer
802 views

Replacement for EnsureSuccessStatusCode

I like the simplicity of EnsureSuccessStatusCode for HttpResponseMessage after a call using ...
Vaccano's user avatar
  • 317
2 votes
2 answers
857 views

Exponential retry handler implementing DelegatingHandler in C#

I am writing a small library where I don't want to include Polly since I want to keep the number of dependencies as small as possible. I also thought it was a good learning exercise to do this on my ...
jokarl's user avatar
  • 143
5 votes
1 answer
155 views

C# console app to subscribe to Chuck Norris API

I'm a newbie when it comes to programming. I'm working on a console app that subscribes to ChuckNorris JSON API and displays the results. I believe I took into account all possible scenarios. Do you ...
TheChosenOne94's user avatar
4 votes
1 answer
2k views

Use a static field for cache an authentication token in .NET API

I have a .NET 6 web API that does some requests to another third party API, this API has a token that expires after a few hours, so I want to cache this token and reuse in the requests. Here how I ...
Vanderlei Adriano's user avatar
2 votes
1 answer
4k views

HttpClient retry handler on response 429

When the remote server returns a 429 (Too Many Requests) response with the Retry-After header, the HttpClient can handle such cases with a handler: ...
sDima's user avatar
  • 849