Skip to content

Instantly share code, notes, and snippets.

@mwiedemeyer
Created October 19, 2014 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwiedemeyer/151eaeb7e5ecac1b36d2 to your computer and use it in GitHub Desktop.
Save mwiedemeyer/151eaeb7e5ecac1b36d2 to your computer and use it in GitHub Desktop.
static void Main(string[] args)
{
ClientContext context = new ClientContext("https://sharepoint/sites/test1");
context.ExecutingWebRequest += context_ExecutingWebRequest;
var web = context.Web;
context.Load(web);
context.ExecuteQuery();
Console.WriteLine("Title: " + web.Title);
}
static void context_ExecutingWebRequest(object sender, WebRequestEventArgs e)
{
e.WebRequestExecutor.WebRequest.PreAuthenticate = true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment