标签:exp 数据请求 erro result pos 数据 ISE accept post
export default class HttpUtils { static get(url){ return new Promise((resolve,reject)=>{ fetch(url) .then(response=>response.json()) .then(result=>{ resolve(result) }) .catch(error=>{ reject(error) }) }) } static post(url,data){ return new Promise((resolve,reject)=>{ fetch(url,{ method:‘post‘, header:{ ‘Accept‘:‘application/json‘, ‘Content-Type‘:‘application/json‘ }, body:JSON.stringify(data) }) .then(response=>response.json()) .then(result=>{ resolve(result) }) .catch(error=>{ reject(error) }) }) } }
标签:exp 数据请求 erro result pos 数据 ISE accept post
原文地址:https://www.cnblogs.com/nixu/p/9886593.html