可能未处理的承诺拒绝(id:0)React native axios

时间:2018-01-28 08:49:13

标签: json reactjs request native

我在互联网上找到了一个json数据,我的应用程序正在运行,但是当我将相同的json数据复制到我的主机时。它不起作用。 一切都是一样的只是链接是不同的。你能帮帮我吗?

这是有效的

    state = { data: [] };
  componentWillMount() {
    axios.get('https://rallycoding.herokuapp.com/api/music_albums')
    .then(response => this.setState({ data: response.data }));
  }

这不起作用

      state = { data: [] };
  componentWillMount() {
    axios.get('http://ozandikbas.com/sendingdata2')
    .then(response => this.setState({ data: response.data }));
  }

enter image description here

0 个答案:

没有答案