title: REST C# Get List Items
body: <p>I am completely new to REST API.<br>
  I would like to retrieve ListItems in xml format from an external site in C#.<br>
  I have got the username and password for the site (which uses Mixed authentication by the way). </p>
  
  <pre><code>HttpWebRequest endpointRequest = (HttpWebRequest)HttpWebRequest.Create("https://&lt;site&gt;/_api/web/lists");
  endpointRequest.Method = "GET";
  endpointRequest.Accept = "application/atom+xml";
  //endpointRequest.Headers.Add("Authorization", "Bearer " + accessToken);
  
  
  
  endpointRequest.Headers["Authorization"] = "Basic " + Convert.ToBase64String(Encoding.Default.GetBytes("&lt;domain&gt;\\&lt;username&gt;:&lt;password&gt;"));
  
  HttpWebResponse endpointResponse = (HttpWebResponse)endpointRequest.GetResponse();
  </code></pre>
  
  <p>I am using this piece of code that I found on MSDN.<br>
  Would anybody please be kind enough to tell me how do I get an access token?<br>
  Why am I getting 403 Forbidden error?</p>