About 22,600 results
Open links in new tab
  1. c# - Best Practice for Use HttpClient - Stack Overflow

    May 11, 2016 · What about creating HttpRequestMessage for each request? And then use the SendAsync method of HttpClient. That way you can specify different credentials between …

  2. c# - How to get HttpClient to pass credentials along with the request ...

    Aug 31, 2012 · I get "The target principal name is incorrect" when using HttpClient with the above solution, but using WebClient with a similar setup passes the user's credentials through.

  3. c# - HttpClient in using statement - Stack Overflow

    Oct 22, 2016 · HttpClient is intended to be instantiated once and re-used throughout the life of an application. Especially in server applications, creating a new HttpClient instance for every request …

  4. c# - Make Https call using HttpClient - Stack Overflow

    Mar 7, 2014 · I have been using HttpClient for making WebApi calls using C#. Seems neat & fast way compared to WebClient. However I am stuck up while making Https calls. How can I …

  5. c# - HttpClient - A task was cancelled? - Stack Overflow

    Mar 21, 2015 · Instead, HttpClient interface is a bit crufty, and the correct way to use it in dotnet core 2.1+ is: Use a static or singleton HttpClient instance with PooledConnectionLifetime... Basically, …

  6. c# - Send HTTP POST request in .NET - Stack Overflow

    Method A: HttpClient (Preferred) Available in: .NET Framework 4.5+, .NET Standard 1.1+, and .NET Core 1.0+. It is currently the preferred approach, and is asynchronous and high performance. Use …

  7. c# - Adding Http Headers to HttpClient - Stack Overflow

    Aug 19, 2012 · To set custom headers on a request, build a request with the custom header before passing it to httpclient to send to http server. Default header is set on httpclient to send on every …

  8. c# - Allowing Untrusted SSL Certificates with HttpClient - Stack …

    Sep 23, 2012 · I'm struggling to get my Windows 8 application to communicate with my test web API over SSL. It seems that HttpClient/HttpClientHandler does not provide and option to ignore …

  9. c# - Correct way to use HttpClient in .NET 8? - Stack Overflow

    Feb 21, 2024 · I have a .NET 8 app where my app is constantly using HttpClient to send requests to a server. Every time that I think I have a handle on the "correct" way to use HttpClient, …

  10. c# - Download file with WebClient or HttpClient? - Stack Overflow

    I am trying to download file from a URL and I have to choose between WebClient and HttpClient. I have referenced this article and several other articles on the internet. Everywhere, it is suggested...