Контейнер для печенья означает?
string outputXml = ""; string url = "https://api.com/endpoint"; string param = "?username=Jey&Password=Pass123"; url = url + param; CookieContainer cookies = new CookieContainer(); HttpWebRequest webRequest = WebRequest.Create(url) as HttpWebRequest; string contentType = "pplication/x-www-form-urlencoded"; System.Net.ServicePointManager.Expect100Continue = false; webRequest.Method = "POST"; webRequest.ContentType = contentType; //webRequest.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); webRequest.CookieContainer = cookies; StreamReader responseReader = new StreamReader(webRequest.GetResponse().GetResponseStream()); string responseData = responseReader.ReadToEnd(); responseReader.Close(); webRequest.GetResponse().Close(); var parsed = JObject.Parse(responseData); string token = parsed.SelectToken("access_token").ToString();
Что я уже пробовал:
CookieContainer cookies = new CookieContainer();
Afzaal Ahmad Zeeshan
О чем говорит это название?