Top "Dotnet-httpclient" questions

Refers to the System.

Custom User Agent for HttpClient?

can I set a custom User Agent for a HttpClient? I need to view websites in their mobile form.

c# dotnet-httpclient
HttpClient: Conditionally set AcceptEncoding compression at runtime

We are trying to implement user-determined (on a settings screen) optional gzip compression in our client which uses HttpClient, so …

c# gzip .net-4.5 dotnet-httpclient winrt-async
Cancelling an HttpClient Request - Why is TaskCanceledException.CancellationToken.IsCancellationRequested false?

Given the following code: var cts = new CancellationTokenSource(); try { // get a "hot" task var task = new HttpClient().GetAsync("http://www.…

c# .net async-await dotnet-httpclient cancellationtokensource
Use HttpClientFactory from .NET 4.6.2

I have a .NET 4.6.2 console application (using Simple Injector). I need to make calls to an HTTP service. Having run …

.net-core dotnet-httpclient
Internal Server Error when doing a POST with HttpClient in Windows Phone 8

I am posting a string to a web server this way: private async Task makeRequest(string url, string postData) { HttpClient …

c# windows-phone-8 internal-server-error dotnet-httpclient asynchttpclient
Making an async HttpClient post request with data from FormCollection

I am doing an Asp.Net MVC 4 project and am looking to an internal request (like a proxy) to our …

c# asp.net-mvc-4 formcollection dotnet-httpclient
StringContent vs ObjectContent

I am using System.Net.Http's HttpClient to call a REST API with "POST" using the following code: using (HttpRequestMessage …

c# json serialization httpclient dotnet-httpclient
When or if to Dispose HttpResponseMessage when calling ReadAsStreamAsync?

I am using the System.Net.Http.HttpClient to do some client-side HTTP communication. I've got all of the HTTP …

c# .net stream idisposable dotnet-httpclient
HttpClient buffer size limit exceeded

I am using my client to get some info about a certain file stored in my Swift Object Storage which …

.net rest dotnet-httpclient
The request message was already sent. Cannot send the same request message multiple times

Is there anything wrong with my code here? I keep getting this error: System.InvalidOperationException: The request message was already …

c# .net async-await dotnet-httpclient func