本文主要是介绍【JavaScript】SpringMVC Http请求415 Unsupported Media Type的问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
需要在请求$ajax请求头部增加
contentType: "application/json; charset=utf-8",
例如:
function sendEmailToCandidate(id) {console.log(id);var params = {};params["vars"] = {"formId": id};params["tableMap"] = {};params["flag"] = "";$.ajax({"contentType": "application/json; charset=utf-8","type": "POST","url": "push_approve","data": JSON.stringify(params),"success": function (resp) {console.log(resp);showSuccessTips(resp.data);},error: function () {showCommonNoticeDialog('网络错误', 'icon-bolt',generateNoticeMsg('网络错误,请刷新后重试!'), 300);}});
}
这篇关于【JavaScript】SpringMVC Http请求415 Unsupported Media Type的问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!