title: Invalid Token '=' in class,struct or interface member declaration
body: <p>So I'm trying to use the <code>request.Credentials</code> function and am having the following error after building the solution..</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Net;
  using System.Net.Http;
  using System.Web.Http;
  using System.Web.Caching;
  
  
  namespace com.tortoise.Controllers
  {
      public class VebraController : ApiController
      {
  
          public class HttpHeader
          {
          string username = "foo";
          string password = "foo";
  
          string url = "www.test.com";
  
           HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
  
          .
          NetworkCredential myCredentials = new System.Net.NetworkCredential(username,password);
          string usernamePassword = (username + password);
  
          cache = new CredentialCache(); 
  //Invalid Token '=' in class,struct,interface  member declaration, also for CredentialCache &gt; //Method must have a return type.
  
              CredentialCache cache.Add(Uri url); "Basic",myCredentials); 
  //Invalid token "Basic" in class,struct,or interface member declaration, same with the ')'.
  
              request.Credentials = CredentialCache cache; 
  //Invalid Token '=' in class,struct,interface member declaration
  
              request.Headers.Add("Authorization", "Basic " + 
  //Invalid Token '(' in class,struct,interface or declaration 
  Convert.ToBase64String(Encoding.ASCII.GetBytes(usernamePassword)); 
  //Invalid Token '(' in class,struct,interface or declaration same for GetBytes. and end of usernamePassword
  
              // Get the token from the response: 
              string token = response.GetResponseHeader("Token"); 
  
  
              HttpWebResponse response = (HttpWebResponse)request.GetResponse();
              response.Write (response.StatusCode) ;
   //Invalid Token '(' in class,struct,interface or declaration same for ')'
                  }
  </code></pre>
  
  <p>I have included the errors received within the code above. Hopefully they will improve clarity of the issues I have.</p>