Chrome接口改参数后立刻调试方法
- F12开控制台
- 带Network页面,发起正常请求
- 选定请求,鼠标右键,Copy as fetch
- 切换到Console页面,粘贴
- 在请求后面添加以下代码,形成可收到结果和捕捉错误的语句
.then(response=>response.json()).then(data=>console.log(data)).catch(e=>console.log(e));
- 回车发出请求,并可以在console界面看到结果或错误
.then(response=>response.json()).then(data=>console.log(data)).catch(e=>console.log(e));