Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
110 views

I do have a .NET 8.0 web application using HttpClient to send requests to different vendors. To get the HttpClient objects, I'm using the IHttpClientFactory interface installed via AddHttpClient ...
Peter's user avatar
  • 41
2 votes
3 answers
211 views

Here's a .NET 4.6.2 API web client uploading a file - simple stuff: var webClient = new ApiWebClient(); webClient.Timeout = timeout; webClient.Headers.Add( HttpHeaderNames.CONTENT_TYPE, contentType );...
FoxScully's user avatar
  • 111
0 votes
2 answers
627 views

I am developing a simple ASP.NET Core Web API which redirects its calls to different APIs (heavy load). All of the APIs I call have the same settings, just different URIs. The code logic determines ...
WeHaveCookies's user avatar
1 vote
1 answer
78 views

Currenty I'm building a solution which is basically an integration between multiple external REST services. Since the solution is having multiple external service, I want to use the .NET ClientFactory ...
RichioRobo's user avatar
1 vote
1 answer
861 views

I have a .NET Core 8 project where i need to send large amount of concurrent request as fast as possible to a SOAP webservice. I am experiencing long responsetime when creating new HttpClient per ...
Marschall's user avatar
1 vote
1 answer
98 views

I have lots of HttpClient dependency-injected services. I use an HttpClientFactory to get these. There are variations, but in a simple case: // Configure a named and configured HTTP client called &...
Keith's user avatar
  • 157k
1 vote
1 answer
400 views

I would like to unit test a factory in which I inject IHttpClientFactory and this factory create a class that uses a HttpClient. This is the code: public class ClientFactory : IClientFactory { ...
Álvaro García's user avatar
3 votes
1 answer
261 views

based on the article https://learn.microsoft.com/en-us/dotnet/architecture/microservices/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests // in startup.cs ...
user22155685's user avatar
1 vote
1 answer
849 views

I have Azure function app on dedicated premium App service plan. Function in one execution has to delivery two times some data to one api's endpoint. For sending data, I use http client which is ...
Provader's user avatar
0 votes
1 answer
2k views

I'm migrating an app from Xamarin Forms using Prism and DryIoc to Maui and need to register a service and HttpClientFactory outside of the CreateMauiApp function (Reason being I don't know the endpint ...
ledragon's user avatar
  • 301
-1 votes
1 answer
928 views

EDIT: This code does work. I had the wrong value in the Entity List Environment Variable I've been trying to add certificates to the HTTP client factory using dependency injection. I will need to ...
MartinFozzie's user avatar
-1 votes
1 answer
927 views

I'm wondering if my implementation in my webAPI is correct: Startup.cs => ConfigureServices services.AddHttpClient("MyHttpClient") Startup.cs => Configure applicationLifetime....
Alon S's user avatar
  • 195
0 votes
1 answer
208 views

I'm going to get reports over call/message on Twilio via API. They have a limitation of 1000 reports on a single page. The requested GET query is something like this https://api.twilio.com/2010-04-01/...
Earlingh's user avatar
1 vote
2 answers
2k views

We have implemented IHttpClientFactory to make the third party calls using HttpClient in .NET Core. However, we are still getting the below errors. System.IO.IOException: Unable to read data from the ...
XamDev's user avatar
  • 3,687
-1 votes
1 answer
681 views

I use the HttpClientFactory together with Refit to make API calls. I want to use Polly for Retry, Circuit Breaker and Fallback, and while it's easy to set up Retry and Circuit Breaker, I struggle with ...
Bjoern's user avatar
  • 445
0 votes
0 answers
743 views

I have a .NET standard 2.0 class library which is responsible for making all the HttpClient calls from the applications that consume the library. With all the understanding from the Microsoft ...
sohil bhalla's user avatar
1 vote
1 answer
907 views

How is it possible that I get this error message in the setup of a client when I use HttpClientFactory? Who is already using this client? I've been trying both like this as a named client and also by ...
steb's user avatar
  • 662
0 votes
2 answers
1k views

If I use _httpClientFactory.CreateClient() in a singleton (no name for the client, I set it up when I use it) Should I add/specify an empty services.AddHttpClient(); at startup or is that not ...
steb's user avatar
  • 662
0 votes
1 answer
156 views

Is there any issue with below implementation inside Blazor component? A lot of examples repeatedly use CreateClient inside every method and I am wondering if it can be handled by a property, in one ...
Pawel's user avatar
  • 1,367
0 votes
1 answer
285 views

I want to sync data from remote api! something like 1M record! but the whole process talks about 5Mins. as a user experience, that's very bad thing to do! I want the whole process takes less than 1S! ...
Mahmmoud Kinawy's user avatar
0 votes
1 answer
324 views

Take for example the following, I use a single httpClient, assign the BaseAddress, and then pass it to the client that will ultimately use it: var httpClient = httpClientFactory.CreateClient("...
dddave's user avatar
  • 45
2 votes
3 answers
2k views

Update 20221024: I have used Ruikai Feng's solution in order to use Mockoon with my tests. I realize this is not a correct approach from a unit testing approach and am working to change my approach. ...
usagibear's user avatar
  • 395
3 votes
1 answer
4k views

My service definition: var host = new HostBuilder().ConfigureServices(services => { services .AddHttpClient<Downloader>() .AddPolicyHandler((services, request) => ...
Dr. Strangelove's user avatar
11 votes
1 answer
5k views

TL;DR In .NET 6: What is the lifetime of a typed HttpClient instance from IHttpClientFactory where the type that will receive it is registered as "Scoped"? Shouldn't it be kind of a "...
cezarlamann's user avatar
  • 1,593
3 votes
0 answers
4k views

I have the below code that I wish to transfer over to a .NET 6 Core. HttpClientHandler handler = new HttpClientHandler(); HttpClient client = new HttpClient(handler); CookieContainer cookieContainer = ...
Richard's user avatar
  • 1,126