我正在尝试通过node.js统一将登录数据发送到服务器,并且node.js将返回登录用户的ID。但帖子不起作用。 C#代码
form.AddField("usernamePost" , username);
form.AddField("passwordPost" , password);
print(username + " " + inputPassword);
UnityWebRequest www = UnityWebRequest.Post(LoginURL,form);
yield return www.SendWebRequest();
//spinner.Dismiss();
string value= www.downloadHandler.text;
这是 nodejs 代码
app.use('/ownerLogin', (req,res) =>{
let username=req.query.ownerIdPost;
let userPassword=req.query.passwordPost;
console.log(username);
console.log(userPassword);
我尝试过
req.param
req.params
req.body
它给出了空且未定义,我还将请求方法更改为
app.get('/ownerLogin', (req,res) =>{.....
and
app.post('/ownerLogin', (req,res) =>{....
但是对我没有任何帮助。请帮助我