var url = "address"; var cookieContainer = new CookieContainer(); using (var handler = new HttpClientHandler() { CookieContainer = cookieContainer }) using (var client = new HttpClient(handler) { }) { cookieContainer.Add(new Uri("youdomain"), new Cookie("cookieName", "cookieValue")); var result = client.GetStringAsync(url).Result; return Content(result); }
时间: 2024-12-06 10:40:15