onLoad(url){ fetch(url) .then(response=>response.json()) .then(result=>{ this.setState({ result:JSON.stringify(result) }) }) .catch(error=>{ this.setState({ result:JSON.stringify(error) }) }) }onSubmit(url){ fetch(url,{ method:'POST', headers:{ 'Accept':'application/json', 'Content-Type':'application/x-www-form-urlencoded' }, // body:JSON.stringify({ // session_id:"ccf80d15403caf12cb41e9fc8c4327630ef03b76"
ReactNative之fetch请求报错解决
最新推荐文章于 2022-07-15 15:44:49 发布