title: Couldn't load resource Error : net::ERR_CONNECTION_REFUSED
body: <p>i'm using react JS for front end and .NET API for backend , i'm trying to fetch data from API , i enabled CORS (i added some configuration in startup file ) and it's all fine normally .
  in react js , i want to fetch data using my API so this is my code to show a list of data : </p>
  
  <pre><code>import React from "react";
  import ReactDOM from "react-dom";
  import "antd/dist/antd.css";
  import { List, Avatar, Button, Spin } from "antd";
  import PropTypes from "prop-types";
  import { withStyles } from "@material-ui/core/styles";
  
  import reqwest from "reqwest";
  
  const fakeDataUrl =
    "http://localhost:51492/api/experience/";
  
  class LoadMoreList extends React.Component {
    state = {
      loading: true,
      loadingMore: false,
      showLoadingMore: true,
      data: []
    };
  
    componentDidMount() {
      this.getData(res =&gt; {
        this.setState({
          loading: false,
          data: res.results
        });
      });
    }
  
    getData = callback =&gt; {
      reqwest({
        url: fakeDataUrl,
        type: "json",
        method: "get",
        contentType: "application/json",
        success: res =&gt; {
          callback(res);
        }
      });
    };
  
    onLoadMore = () =&gt; {
      this.setState({
        loadingMore: true
      });
      this.getData(res =&gt; {
        const data = this.state.data.concat(res.results);
        this.setState(
          {
            data,
            loadingMore: false
          },
          () =&gt; {
            // Resetting window's offsetTop so as to display react-virtualized demo underfloor.
            // In real scene, you can using public method of react-virtualized:
            // https://stackoverflow.com/questions/46700726/how-to-use-public-method-updateposition-of-react-virtualized
            window.dispatchEvent(new Event("resize"));
          }
        );
      });
    };
  
    render() {
      const { loading, loadingMore, showLoadingMore, data } = this.state;
      const loadMore = showLoadingMore ? (
        &lt;div
          style={{
            textAlign: "center",
            marginTop: 12,
            height: 32,
            lineHeight: "32px"
          }}
        &gt;
          {loadingMore &amp;&amp; &lt;Spin /&gt;}
          {!loadingMore &amp;&amp; (
            &lt;Button onClick={this.onLoadMore}&gt;loading more&lt;/Button&gt;
          )}
        &lt;/div&gt;
      ) : null;
      return (
        &lt;List
          style={{
            width: "50%",
            left: "25%"
          }}
          className="demo-loadmore-list"
          loading={loading}
          itemLayout="horizontal"
          loadMore={loadMore}
          dataSource={data}
          renderItem={item =&gt; (
            &lt;List.Item
              actions={[
                &lt;Button type="primary" icon="user-add"&gt;
                  suivre
                &lt;/Button&gt;,
                &lt;a&gt;Message&lt;/a&gt;
              ]}
            &gt;
              &lt;List.Item.Meta
                avatar={
                  &lt;a&gt;
                    &lt;Avatar src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" /&gt;{" "}
                  &lt;/a&gt;
                }
                title={&lt;a href="https://ant.design"&gt;{item.titre}&lt;/a&gt;}
               /&gt;
            &lt;/List.Item&gt;
          )}
        /&gt;
      );
    }
  }
  
  LoadMoreList.propTypes = {
    classes: PropTypes.object.isRequired
  };
  
  export default withStyles()(LoadMoreList);
  </code></pre>
  
  <p>this code will show a list of experiences and it allows us to load more data clicking on LoadMore 
  but what i get when i start the project : </p>
  
  <p><a href="https://i.stack.imgur.com/cELxr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cELxr.png" alt="enter image description here"></a></p>
  
  <p>and in DevTools i get this error 
  Failed to load resource: net::ERR_CONNECTION_REFUSED</p>
  
  <p>i looked in google for many solutions but no one helped me </p>
  
  <p>thanks for helping me .</p>