title: Rest call WebException 401 Unauthorized only in mixed authentication webapp
body: <p>I've come across a strange behaviour when trying to make a rest call from outside an SharePoint app (specificly from a .NET console application). As long as I use DefaultCredentials everything is fine, as long as my webapplication does not allow FBA (form based authentication) I'm able to hand over NetworkCredentials without problems.</p>
  
  <p>But as soon as FBA authentication is activated I'm not able to make the rest call and 401 Unauthorized is returned.</p>
  
  <pre><code>var req = (HttpWebRequest)HttpWebRequest.Create("http://{url}/_api/web/title");
  req.Method = "GET";
  req.Credentials = new NetworkCredential("{user}", "{pass}");
  req.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
  var response = (HttpWebResponse)req.GetResponse();
  </code></pre>
  
  <p>I also tried this way to hand over credentials like this:</p>
  
  <pre><code>var req = (HttpWebRequest)HttpWebRequest.Create("http://{url}/_api/web/title");
  req.Method = "GET";
  req.Headers.Add("X-FORMS_BASED_AUTH_ACCEPTED", "f");
  var ccache = new CredentialCache();
  ccache.Add(new Uri("http://{url}"), "Basic", new NetworkCredential("{user}", "{pass}"));
  req.Credentials = ccache;
  var response = (HttpWebResponse)req.GetResponse();
  </code></pre>
  
  <p>Does anyone have a hint or idea what could be wrong and how I can achieve my goal to access rest api with credentials in a mixed authentication web app?</p>