About 22,000 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# - 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 …

  3. c# - How to POST using HTTPclient content type = application/x …

    I am currently developing a wp8.1 application C#, i have managed to perform a POST method in json to my api by creating a json object (bm) from textbox.texts. here is my code below. How …

  4. c# - Deciding between HttpClient and WebClient - Stack Overflow

    I started to evaluate WebClient and HttpClient. I downloaded HttpClient for .NET 4.0 from NuGet. I searched for differences between WebClient and HttpClient and this site mentioned that single …

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

    Aug 19, 2012 · I need to add http headers to the HttpClient before I send a request to a web service. How do I do that for an individual request (as opposed to on the HttpClient to all future …

  6. 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...

  7. c# - What is the overhead of creating a new HttpClient per call in a ...

    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 will …

  8. c# - Singleton httpclient vs creating new httpclient request - Stack ...

    Feb 14, 2018 · I am trying to create layer for webservice using HttpClient in my Xamarin.Forms mobile app. without singlton pattern with singleton pattern in first approach i am creating new …

  9. c# - Setting Authorization Header of HttpClient - Stack Overflow

    Jan 31, 2013 · I have an HttpClient that I am using for a REST API. However I am having trouble setting up the Authorization header. I need to set the header to the token I received from doing …

  10. c# - How to set the Content-Type header for an HttpClient request ...

    Aug 27, 2018 · I'm trying to set the Content-Type header of an HttpClient object as required by an API I am calling. I tried setting the Content-Type like below: using (var httpClient = new …