在封装完Axios后,发现post请求出现400.

找原因发现是请求头的问题。请求的 Content-Type:是 application/json;charset=UTF-8
解决方案:设置post请求头,将参数转换为query参数.

Axios post 请求400

Axios post 请求400

Axios post 请求400

参考了大神的文章:https://blog.csdn.net/csdn_yudong/article/details/79668655#_78

相关文章: