我试图在API上发布一些查询参数.当我尝试将mail和firstname作为查询参数传递时,这正在处理PostMan/Insomnia:
http://localhost:8000/api/mails/users/sendVerificationMail?mail=lol%40lol.com&firstname=myFirstName
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试使用我的本机应用程序时,我收到400错误(无效的查询参数).
这是post方法:
.post(`/mails/users/sendVerificationMail`, {
mail,
firstname
})
.then(response => response.status)
.catch(err => console.warn(err));
Run Code Online (Sandbox Code Playgroud)
(我的邮件和名字是console.log如下:lol@lol.com
和myFirstName
).
所以我不知道如何在我的请求中使用Axios传递查询参数(因为现在,它正在通过data: { mail: "lol@lol.com", firstname: "myFirstName" }
.
谢谢您的帮助.