title: How to get anti forgery token
body: <p>Hi i need to test a download link for that i need to login , When i try to log in with the below code i get redirect back to error page since i don't have the anti forgery token , Can you tell me how to get the anti forgery token , I am very new to this thanks in advance </p>
  
  <pre><code>//Make a post to LoginTest page
  HttpWebRequest request = WebRequest.Create(loginUrlwith the login credential ) as HttpWebRequest;
  request.Method = "HEAD";
  HttpWebResponse response = request.GetResponse() as HttpWebResponse;
  
  HttpWebRequest request2 = WebRequest.Create(downloadurl) as HttpWebRequest;
  request2.CookieContainer = new CookieContainer();
  request2.CookieContainer.Add(response.Cookies);
  HttpWebResponse response2 = request2.GetResponse() as HttpWebResponse;
  </code></pre>