Is it possible to use cts.Token when i'am reading async via httpClient?
Here is what i'm trying to do.
using (var client = new HttpClient()) { client.Timeout = TimeSpan.FromMilliseconds(20000); var response = await client.PostAsync("http://" + MyIp + ":9090/api/SqlAction/", new StringContent(postQuery, Encoding.UTF8, "application/json"), cts.Token); if (response.IsSuccessStatusCode) { string content = await response.Content.ReadAsStringAsync(cts.Token); } But i am taking Error CS1501 No overload for method 'ReadAsStringAsync' takes 1 arguments
response.Contentis of typeHttpContent, andReadAsStringAsyncdoesn't take any parameters. See: learn.microsoft.com/en-us/dotnet/api/…