Hi,
I am getting the following error when I try to login into sharepoint using the Httpwebrequest.
Code is as follows
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create("https://xyz.sharepoint.com/");
request.Credentials = new System.Net.NetworkCredential("ABC@xyz.onmicrosoft.com", "123456");
request.UserAgent = "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)";
request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
request.Method = "GET";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
var val = response.GetResponseStream();
string sourceCode;
using (StreamReader sr = new StreamReader(getResponse.GetResponseStream()))
{
sourceCode = sr.ReadToEnd();
} Ramakrishna