React-Native之网络请求

一、GET接口

let url = 'https://news-at.zhihu.com/api/4/themes'
        fetch(url)
      .then((response) => response.json())
      .then((responseJson) => {
          this.setState({
              list: responseJson.others,
          });
      })
      .catch((error) => {
        console.error(error);
      });

二、POST接口

猜你喜欢

转载自blog.csdn.net/yuge486/article/details/81666818
今日推荐