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

I have to upload a file to an embedded device running an API. First, I tried to write methods to do this in a test project. This works great: private static async Task<HttpResponseMessage?> ...
Oliver Bleen's user avatar
0 votes
0 answers
56 views

I try to move a request with certificate from an old system made with NodeJS to a new system using .NET 8.0. Running the .NET code, however, I always get the following error: The SSL connection could ...
Chanom First's user avatar
  • 1,146
-3 votes
0 answers
74 views

I have a legacy .NET 4.8 framework project. I have tried to get these headers: Accept-Encoding CacheControl sent to my endpoint. But looking with Fiddler, they are not sent, even if I explicitly set ...
tdsrhh's user avatar
  • 1
Best practices
0 votes
3 replies
59 views

Our application is somewhat of a middleman that transforms data from numerous APIs. Initially to simplify things, we wrote a bunch of specific clients which wrap an instance of HttpClient created in ...
MetallicHydrogen's user avatar
Best practices
2 votes
4 replies
74 views

I am using HttpClient in .NET 9 to get content that has a JSON part along with a base-64 encoded file. Reading the content as a string, I don't see a clear format that would ensure consistent parsing ...
NeartCarp's user avatar
  • 227
0 votes
1 answer
182 views

In Windows 7 32-bit, on .NET 4.6.1, this code works fine and the remote server is returning data: using (HttpClient client = new HttpClient()) { client.Timeout = TimeSpan.FromSeconds(3); ...
panci matika's user avatar
3 votes
2 answers
163 views

We use the following function to test internet connectivity every 5 seconds. But in some part of the world, this function always returns false. Now, the problem is we can set a proxy server in Windows ...
Ming's user avatar
  • 595
1 vote
0 answers
59 views

I'm working on a .NET MAUI Android app that sends order data to a Web API using HttpClient. On normal Wi-Fi connections everything works fine, but when I throttle the network speed to around 56 kbps (...
Lasitha Lankajeewa's user avatar
1 vote
0 answers
65 views

I'm working on a console application to automatically interact with an API that needs and OAuth authorized user with a specific set of claims. If I use a browser to log in with a username and password ...
user31727878's user avatar
5 votes
3 answers
156 views

I have an HttpClient built with IHttpClientFactory and Microsoft.Extensions.Http.Resilience retry on 401. Pipeline: Primary: HttpClientHandler (AllowAutoRedirect = false) Delegating: ....
Artyom Avetisyan's user avatar
2 votes
1 answer
121 views

I'm trying to download a webpage from a specific website (Bandcamp). I'm getting different results although the request seems the same: On Windows 10, using a HttpClient in C#: I'm getting "...
Otiel's user avatar
  • 18.8k
1 vote
1 answer
105 views

I have a .NET Core project with two layers: an API layer and a UI layer, both in the same solution. The UI layer is built with ASP.NET Core MVC, where controllers call services, and the services use ...
za mk's user avatar
  • 11
4 votes
1 answer
159 views

My HttpListener for some reason can't listen to prefix http://127.0.0.100:50001/, getting an error Unhandled exception. System.Net.HttpListenerException (32): The process cannot access the file ...
Roman Kovalov's user avatar
1 vote
0 answers
53 views

The http spec allows multiple responses per http request: A single request can have multiple associated responses: zero or more "interim" (non-final) responses with status codes in the &...
Volker's user avatar
  • 1,849
0 votes
0 answers
52 views

I have a problem, I get this error [0:] Connection failure: ERROR {0} when using a connection in a .NET MAUI project for Android. I applied the Microsoft instruction for the case when the API works ...
Артур Дементьев's user avatar
1 vote
1 answer
99 views

I have an API service class that implements HttpClient to connect to my API, I have a user list model, and I have a View Model using the Community Toolkit MVVM approach. I would like to understand how ...
Артур Дементьев's user avatar
1 vote
1 answer
101 views

I have a problem because I'm relatively new to this and I'm trying to learn and do things at the same time, and I'm not sure if I'm doing it correctly. I need to get data from my API in the view model ...
Артур Дементьев's user avatar
1 vote
1 answer
107 views

I'm using a .NET HttpClient to connect to a server over HTTPS. For best practice, I want to check the certificate hasn't been revoked, by setting HttpClientHandler.CheckCertificateRevocationList = ...
Simon W's user avatar
  • 111
0 votes
0 answers
61 views

The calling application calls the auth endpoint of an API to receive a token. The API will, on successful authentication, return a JWT bearer token for the calling application to then use in ...
David Hirst's user avatar
  • 2,032
0 votes
0 answers
35 views

I’m trying to make TLS calls using HttpClient in an Azure App Service (Windows) with a certificate that is dynamically loaded at runtime (e.g., from blob storage or Key Vault as a byte array). A third-...
Ellen's user avatar
  • 1
2 votes
1 answer
80 views

I am refactoring my code and moving some classes to an external assembly. In my projects I use Refit and currently I set it up like this in Startup: services.AddHttpClient(); services.AddRefitClient&...
Ivan Debono's user avatar
  • 1,016
4 votes
1 answer
643 views

Working on project, we have upgraded to .Net 9. I am getting a warning in Program.cs at below line: ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls13 | SecurityProtocolType.Tls12; ...
Mayur Narkhede's user avatar
0 votes
0 answers
103 views

I'm experiencing a caching issue with Refit when calling Keycloak Admin API endpoints. Despite setting various no-cache headers and implementing a custom HttpMessageHandler, I'm still getting cached ...
Alptekin's user avatar
1 vote
0 answers
46 views

I try to call an azure hosted API from local IIS, but keep getting the error: ssl connection could not be established. authentication failed. The message received was unexpected or badly formatted ...
AGuyCalledGerald's user avatar
1 vote
0 answers
141 views

Currently, I have this configuration for http client that I can use and inject when needed, wrapped with JWT authentication to hit some API address that has multiple end points: builder.Services....
Prefetcher Shatnawi's user avatar
0 votes
0 answers
60 views

I'm encountering an issue where HttpClient fails to establish an HTTPS connection to a specific site (https://www.csgt.vn) when running inside a Docker container. This is the minimal code: var client =...
Nam Pham's user avatar
3 votes
2 answers
201 views

I have put together an example code that shows what I mean. I am trying to download two different datasheets, one from TI, the other from ST. Both exist and I can download them using any browser (even ...
Tom L.'s user avatar
  • 1,054
2 votes
1 answer
279 views

My use case is I have a series of services running via Docker Compose, each using the deploy.replicas attribute to get some n number of instances. services: myservice: image: ... ports: ...
joelc's user avatar
  • 2,841
2 votes
0 answers
46 views

Why might this Windows.Web.Http.HttpClient instance work on one computer and not another? I've found these three posts that talk about why Windows.Web.Http.HttpClient.GetAsync might not ever return ...
Brian A. Henning's user avatar
4 votes
1 answer
167 views

I want to download a web page using HttpClient in .NET, but I receive a 403 Forbidden response, whereas using Postman with the same request parameters, I get a 200 OK. Here's my C# code: var client = ...
Paul Dubsky's user avatar
0 votes
1 answer
202 views

The code generated by NSwag allows the consumer to pass a CancellationToken, which it uses on the call to HttpClient.SendAsync, but it doesn't use on the downstream call to response.Content....
Andrew's user avatar
  • 241
2 votes
1 answer
140 views

I am using System.Net.HttpClient in a client application and needing to PUT to a third party service I have no control over. The third party service gives responses such as: Date: Wed, 04 Jun 2025 20:...
Cinder Biscuits's user avatar
0 votes
1 answer
96 views

We are using the new Keyed DI support in IHttpClientFactory in .NET 9, with different clients defined for each API endpoint. Defining static values, such as the base URL is straight forward, but we ...
Josh's user avatar
  • 8,551
0 votes
0 answers
76 views

I recently updated and migrated my backend from SOAP WCF to a REST API (C#). This backend is utilized by an Outlook add-in (desktop version) to save documents, including emails and attachments, to a ...
Mihai Zotescu's user avatar
0 votes
2 answers
60 views

I'm trying execute an HTTP request to receive some data (for example as a stream), but with ability to cancel this request at any time. I've read about CancellationToken and use it for cancel request (...
ibogolyubskiy's user avatar
0 votes
1 answer
216 views

Technical details Client applications are using .NET 6 Client applications are using the OpenAIClient class from the official OpenAI nuget library There is an inhouse cluster of LLM servers with ...
Mario's user avatar
  • 847
0 votes
2 answers
116 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
1 vote
0 answers
107 views

ASP.NET Core 8 Web API service with can execute another service. I read this: https://www.aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/ https://byterot.blogspot.com/2016/07/singleton-...
merve şahinoglu's user avatar
0 votes
2 answers
105 views

I'm getting multiple intermittent 'Socket Exception' error while using httpclient(IHttpClientFactory DI Implementation) . As per MS documentation, A new HttpClient instance is returned each time ...
Nishad's user avatar
  • 35
0 votes
0 answers
65 views

HttpClient.PostAync does not reach controller endpoint at all. GetAsync and DeleteAsync are OK. Program.cs: builder.Services.AddControllersWithViews(); app.MapControllers(); Controller: [Route("...
khteh's user avatar
  • 4,280
-1 votes
2 answers
47 views

What is the best way to dynamically change the timeout of an application if we are using IHttpClientFactory? I don't mean I want a different timeout for different addresses or endpoints - I mean all ...
Brad's user avatar
  • 1,423
0 votes
1 answer
100 views

The environment is a .net (.net7.0) service, running in a Linux-based Docker container. It needs to communicate with an external REST API, download a large-ish zipped file, unzip it and upload to an ...
Yuri Makassiouk's user avatar
5 votes
0 answers
307 views

here is my code: using HttpClient client = new HttpClient(); try { HttpResponseMessage response = await client.GetAsync("http://131.189.89.86:11920/SetupWizard.aspx/yNMgLvRtUj"); } ...
Inside Man's user avatar
  • 4,219
0 votes
2 answers
163 views

I have an API client that calls an API hosted in Kubernetes and using kong for gateway API, which is built using ASP.NET 6. We've also configured a Polly policy to retry the request if it receives an ...
Dhrup's user avatar
  • 89
3 votes
1 answer
125 views

I am creating an Azure function that will download a file from a website and upload to the Blob store. I have the Azure function working locally but it does not work when deployed. I can't see ...
f_olivere's user avatar
0 votes
0 answers
36 views

I have a legacy project running on .NET Framework 4.5, and we recently encountered issues because HttpClient relies on Windows for HTTPS connections. Is there an alternative HttpMessageHandler that ...
Max Bündchen's user avatar
1 vote
1 answer
68 views

I have a predefined IAsyncPolicy<HttpResponseMessage> policy coming from an external assembly. I want to apply this policy to a Http Client, BUT I want to exclude one of the cases this policy ...
Bogey's user avatar
  • 5,916
3 votes
1 answer
65 views

I've exported a request from my Chrome browser using "Copy as PowerShell", trimmed it to a minimum and the script runs successfully: Invoke-WebRequest -Uri "https://www.sec.gov/data-...
vlad2048's user avatar
  • 191
1 vote
0 answers
81 views

I have deployed a feature in my production environment where I need to call a third-party API using HttpClient in .NET. However, I've noticed that there is a consistent 15-second delay when calling ...
Lan Lin's user avatar
  • 45
0 votes
0 answers
69 views

I am creating an ASP.NET Core Web API that is intended to work as a middle ground between several third party API's and a first-party web application to sync data between the third parties and my main ...
Jon Sowers's user avatar

1
2 3 4 5
64