title: axios in React with API throw "network error" exception
body: <p>I developed an API using C# (visual studio) and when i send request to get the data using browser or Postman it's return data successfully,
  in another hand i developed a react application that do CRUD processes by send the requests to my local API service,
  (the visual studio and visual studio code in debug mode) 
  When i send request using my react(axios) application the api service get the request but the axios in Get function throw a network error exception,</p>
  
  <p>I tried a lot of solutions exist in google but no result.</p>
  
  <p>When i use another API like (<a href="http://jsonplaceholder.typicode.com/posts/" rel="nofollow noreferrer">http://jsonplaceholder.typicode.com/posts/</a>) it's work
  but when i use local api (my api) throw a network error</p>
  
  <p>My react code:</p>
  
  <pre><code> import axios from 'axios';
  class Faq extends Component {
  componentDidMount() {
  
          axios.get('http://localhost:53419/api/faqs')
              .then(
              response =&gt; {
                  const faqs = response.data;
                  this.setState(this.state.faqs = { faqs });
              }
              )
          .catch(function (error) {
                  console.log(error);
              });
      }
  }
  </code></pre>
  
  <p>My API Service (Controller) code:</p>
  
  <pre><code>    public class FAQsController : ApiController
      {
  [ResponseType(typeof(FAQs))]
          public List&lt;FAQs&gt; GetFAQs()
          {
              return db.FAQs.ToList();
          }
  }
  </code></pre>
  
  <p>My WebAPIConfig.cs file to convert the data to JSON is:</p>
  
  <pre><code>public static void Register(HttpConfiguration config)
      {
          // Web API configuration and services
  
          // Web API routes
  
          var json = config.Formatters.JsonFormatter;
          json.SerializerSettings.PreserveReferencesHandling = Newtonsoft.Json.PreserveReferencesHandling.Objects;
          config.Formatters.Remove(config.Formatters.XmlFormatter);
          json.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
          ((DefaultContractResolver)config.Formatters.JsonFormatter.SerializerSettings.ContractResolver).IgnoreSerializableAttribute = true;
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
  
      }
  </code></pre>
  
  <p>React package.json configurations:</p>
  
  <pre><code>{
    "name": "compare-react",
    "version": "0.1.0",
    "private": true,
    "dependencies": {
      "axios": "^0.16.2",
      "bulma": "^0.5.0",
      "react": "^15.6.1",
      "react-dom": "^15.6.1",
      "react-scripts": "1.0.10",
      "whatwg-fetch": "^2.0.3"
    },
    "scripts": {
      "build-css": "node-sass-chokidar src/ -o src/",
      "watch-css": "npm run build-css &amp;&amp; node-sass-chokidar src/ -o src/ --watch --recursive",
      "start-js": "react-scripts start",
      "start": "npm-run-all -p watch-css start-js",
      "build": "npm run build-css &amp;&amp; react-scripts build",
      "test": "react-scripts test --env=jsdom",
      "eject": "react-scripts eject"
    },
  
    "devDependencies": {
      "moxios": "^0.4.0",
      "node-sass-chokidar": "0.0.3",
      "npm-run-all": "^4.0.2",
      "webpack": "^3.4.1"
    }
  }
  </code></pre>