fetch("http://localhost:58513/api/decheng/", {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: { "LogId": 3, "UserName": "test" },
})
fetch通过如上代码,在webapi是无法获取到值的,不知道正确的方法应该是什么?
采用'Content-Type': 'application/json',传递json字符串是可以的,我只是想知道当'Content-Type': 'application/x-www-form-urlencoded'时如何向webapi传递参数及获取值