ajax中的put请求和post请求传data值的区别
Posted wssdx
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ajax中的put请求和post请求传data值的区别相关的知识,希望对你有一定的参考价值。
put请求可以传对象
let amount=
expenseAccountId:this.id,
dressBaseList:[
purchasePrice:this.changeReimbursement,
sampleDressId:params.row.sampleDressId
]
post或get请求必须转换为字符串类型
let amount=
expenseAccountId:this.id,
dressBaseList:[
purchasePrice:this.changeReimbursement,
sampleDressId:params.row.sampleDressId
]
let data=JSON.stringify(amount)
以上是关于ajax中的put请求和post请求传data值的区别的主要内容,如果未能解决你的问题,请参考以下文章
Datatables post 动态提交数据(传参数) 异步数据(ajax.data)