Hello! Faced the problem of obtaining information on request. I send cookies to the server, the answer comes 200, but only the headers come to me, how to get the main body? Thank!
public async void GetData(string sessionId, string tokenId, string adress) { var baseAddress = new Uri(Settings.Default.api_url); using (var handler = new HttpClientHandler { UseCookies = true }) using (var client = new HttpClient(handler) { BaseAddress = baseAddress }) { var message = new HttpRequestMessage(HttpMethod.Get, adress); message.Headers.Add("Cookies", "PHPSESSID=" + sessionId + "; CSRF_TOKEN=" + tokenId); var result = await client.SendAsync(message); result.EnsureSuccessStatusCode(); } }
await result.Content.ReadAsStreamAsynctried? - VladD