//Set cookie
var baseAddress = new Uri(send.Host);
var handler = new HttpClientHandler();
HttpClient client = new HttpClient(handler) { BaseAddress = baseAddress };
if (!string.IsNullOrEmpty(send.CookieValue))
{
CookieContainer cc = new CookieContainer();
handler.CookieContainer = cc;
cc.Add(baseAddress, new Cookie(send.CookieName, send.CookieValue));
}
按需要改改