Questions tagged [httpclient]
The httpclient tag has no usage guidance.
5
questions
1
vote
1
answer
142
views
Replacement for EnsureSuccessStatusCode
I like the simplicity of EnsureSuccessStatusCode for HttpResponseMessage after a call using ...
2
votes
2
answers
523
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 ...
5
votes
1
answer
140
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 ...
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 ...
2
votes
1
answer
3k
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:
...