![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
axios请求
| 风梳烟沐 |
这个作者很懒,什么都没留下…
展开
-
解决axios无法使用post发送数据的问题和Headers in preflight跨域问题
// 服务器端 // 1. 从 map 取 前端发过来的 post 数据 Map<String, Object> params = new HashMap<>(); Map<String, String[]> parameterMap = req.getParameterMap(); // 2. 遍历 map 数据 ----> 字符串 String xxxString = ""; if (parameterMap != null)原创 2020-12-15 10:12:25 · 706 阅读 · 0 评论 -
Axios发送请求时params与data的区别
Axios发送请求时params和data的区别 在使用axios时,配置选项中包含params和data两者 区别: 因为params是添加到url的请求字符串中的,用于get请求。 而data是添加到请求体(body)中的, 用于post请求。 eg:post方法 this.axios({ method: 'post', headers: { 'Content-Type': 'applicatio原创 2020-12-15 10:08:03 · 223 阅读 · 0 评论