UNPKG

request-monitor

Version:
53 lines (46 loc) 1.13 kB
<!doctype html> <html> <head> <title>起步</title> </head> <body> <script src="./axios.min.js"></script> <script src="request-monitor.js"></script> <script> window.requestMonitor(info=>{ console.log(info) }) //setInterval(()=>{ let CancelToken = axios.CancelToken var source = CancelToken.source(); axios({ url: 'http://yapi.sankuai.com/mock/974/sss', method: 'get', params: { x: 1 }, timeout: 3000 }).then((s)=>{ console.log(s) }) // setTimeout(()=>{ // source.cancel('cancel') // },1000) //}, 4000) fetch('http://yapi.demo.qunar.com/mock/245/api/pet/111', { method: 'get' }).then(s=>{ setTimeout(()=>{ let result =s.json() result.then(text=>{ }) },1000) }) fetch('http://yapi.demo.qunar.com/mock/245/api/store/order', { method: 'post' }).then(s=>{ s.json() }) </script> </body> </html>