I am sending form data in a post request which I know returns cookies but my cookie variable is being returned as empty
I've tried using GetCookies as you can see but I'm wondering if I can filter the cookies out of my PostAsync Response as I get a 200 response
CookieContainer cookies = new CookieContainer();
HttpClientHandler handler = new HttpClientHandler();
handler.CookieContainer = cookies;
HttpClient client = new HttpClient(handler);
HttpContent content = new StringContent(JsonConvert.SerializeObject(formVals), Encoding.UTF8, "application/json");
HttpResponseMessage response = await client.PostAsync(targetURI.AbsoluteUri , content);
IEnumerable<Cookie> responseCookies = cookies.GetCookies(targetURI).Cast<Cookie>()
foreach (Cookie cookie in responseCookies)
result.Add(cookie);
I expect 2 cookies to come back and be stored in my responseCookies Container