本文共 479 字,大约阅读时间需要 1 分钟。
webapi中如下([FromBody]string jsonData:
public async Task<ResItem> Post([FromBody]string jsonData, string apiName)
注意添加ajax红色部分2个单引号:
$.ajax({
type: 'POST',contentType: "application/json", //加上这个
url: codeUrl + "?apiname=webapi",
data: { '': data64 }, cache: false, async: false,error: function (err) {
alert(JSON.stringify(err)); }, success: function (resItem) { alert(JSON.stringify(resItem)); } });本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/5818689.html,如需转载请自行联系原作者