title: Unable to access library of share point in .net core
body: <p>I got stuck on uploading file on Sharepoint. I am using Microsoft.SharePointOnline2016.CSOM v16.0. </p>
  
  <pre><code>public static void UploadDocumentContent(ClientContext ctx, string libraryName)
  {
       List oList = ctx.Web.Lists.GetByTitle(libraryName);
       ctx.Load(oList.RootFolder);
       ctx.Load(oList.Fields);
       try
       {
            ctx.ExecuteQuery();
       }
       catch (Exception ex)
       {
  
       }
  }
  </code></pre>
  
  <p>I get error following error.</p>
  
  <pre><code>System.Net.WebException: The remote server returned an error: (400) Bad Request.
     at System.Net.HttpWebRequest.GetResponse()
     at Microsoft.SharePoint.Client.SPWebRequestExecutor.Execute()
     at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
     at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
     at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
  </code></pre>