关于axios的封装
来源:9-5 请求函数的封装

Decadez
2021-01-08
封装里面的axios.post(url data {})第一参数是根地址,第二个是我们发送post请求所携带的请求参数数据,那第三个参数请问是什么?是axios里的配置参数?有点懵逼…
还有外层的data={}是代表data的参数个对象或者说是一个json格式吗?
写回答
1回答
-
chenweiyan
2021-01-08
axios.post(url[, data[, config]])
https://github.com/axios/axios#axiosposturl-data-config
第三个参数是配置
外层的data={}是代表data参数的默认值为一个空对象
axios request config: https://github.com/axios/axios#request-config
012021-01-09
相似问题