华为nvr800登录接口调用
var handler = new HttpClientHandler() { Credentials = new NetworkCredential("用户名", "密码"), ServerCertificateCustomValidationCallback = (sender, cert, chain, sslPolicyErrors) => true }; var httpClient = new HttpClient(handler); var response = await httpClient.PostAsync("nvr的ip/API/Web/Login", null); var message = response.EnsureSuccessStatusCode(); if (message.IsSuccessStatusCode) { var headers = response.Headers; var session = headers.First(x => x.Key == "Set-Cookie"); var token = headers.First(x => x.Key == "X-csrftoken"); var result=await response.Content.ReadAsStringAsync(); }