Reactjs fetchJsonp调用引发超时错误

时间:2017-11-08 08:27:33

标签: json reactjs react-native jsonp

我有一个webservice,它使用application / json作为内容类型返回一个JSON字符串。使用Reactjs fetchJsonp函数得到" 超时错误"。这是我的代码块

  fetchJsonp("http://192.168.0.77/test/json.php", {
  method: 'GET'
  })
  .then((response) => response.json())
  .then((responseJson) => {
        return responseJson;
   })
  .catch((error) => {
       //return error;
       console.error(error);
  });

当我运行此代码时,我得到了错误 index.js:2177错误:http://192.168.0.77/test/json.php的JSONP请求超时

0 个答案:

没有答案