[英]How should an AXIOS post handler should look like if I don't use <form action=“” method=“POST”>
[英]How should the parameters for axios look like according to the url example
我有这个 URL。 如何将其转换为 axios 的参数?
customer?$select[0]=id&$select[1]=firstName&$select[2]=lastName&$select[3]=email&$skip=0&$sort[createdAt]=-1&email=test@email.com
const { data } = await this.request({
method: 'get',
url: `/customer`,
params: {
// ?
},
});
通常只需通过键和值设置属性即可。
params: { email: "test@test.com" }
如果key包含特殊字符,JS中的property key是不允许的,可以在key中设置引号
params: { "$select[1]": "firstSame" }
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.