wx.request post 后台接受数据一致为null
发布于 6 年前 作者 fang25 5368 次浏览 来自 问答

小程序:

wx.request({

url: http://localhost:63026/api/News/Uploaddata,

method: ‘post’,

data: “123”,

header: {

“Content-Type”: “application/x-www-form-urlencoded”

},

success: function (res) {

console.log(res)

}

})

后台:

[HttpPost]

        public string  Uploaddata([FromBody]object value)

        {

            string name = HttpContext.Current.Request[“data”];

            return “success2”;

        }

2 回复

为什么??

呵呵,自己好好看看文档吧…

回到顶部