在接口没有问题的情况下(通过postman可以验证)
通常是因为JS请求的数据类型与后端要求不一致,请求类型header处设置
headers: {'Content-Type':'multipart/form-data'}
headers: {'Content-Type':'application/json'}
headers: {'Content-Type':'application/x-www-form-urlencoded'}
选择你需要的方式
在接口没有问题的情况下(通过postman可以验证)
通常是因为JS请求的数据类型与后端要求不一致,请求类型header处设置
headers: {'Content-Type':'multipart/form-data'}
headers: {'Content-Type':'application/json'}
headers: {'Content-Type':'application/x-www-form-urlencoded'}
选择你需要的方式