C# HTTP POST CookieContainer to String
C# HTTP POST CookieContainer to String
資料來源:https://stackoverflow.com/questions/38514230/how-convert-cookiecontainer-to-string
var cookieContainer = new CookieContainer();
var testCookie = new Cookie(“test”, “testValue”);
var uri = new Uri(“https://www.google.com”);
cookieContainer.Add(uri, testCookie);
foreach (var cookie in cookieContainer.GetCookies(uri))
{
Console.WriteLine(cookie.ToString()); // test=testValue
}