title: ASP - running in localhost - unable to reach internet
body: <p>I have an ASP MVC controller action.
  I'm trying to make a web request</p>
  
  <pre><code>public ActionResult Index()
  {
     WebRequest request = HttpWebRequest.Create("http://www.example.com");
     WebResponse response = request.GetResponse();
     string str =  response.ToString();
  }`
  </code></pre>
  
  <p>I get a "WebException occured" the remote name could not be resolved: 'www.example.com'</p>
  
  <p>If I start Fiddler, then the webrequest works.</p>
  
  <p>I tried adding:</p>
  
  <pre><code> &lt;system.net&gt;
   &lt;defaultProxy&gt;
     &lt;proxy usesystemdefault ="True" bypassonlocal="True"  /&gt;
   &lt;/defaultProxy&gt;
  </code></pre>
  
  <p></p>
  
  <p>to Web.config (with and without hte bypassonlocal) and it still doesn't work.</p>
  
  <p>Any suggestions?</p>