1
嗨,所以我有我發送一個jQuery後的數據:如何從jQuery的阿賈克斯後的數據與ExpressJS
$.ajax({
type: "POST",
url: app.config.backend_2 + '/notifications/usernames',
data: data,
contentType: 'application/javascript',
dataType: 'json',
success: function (result) {
console.log(result);
}
});
,這是我的快遞接收器:
exports.save_usernames_for_notifications = function (req, res, next) {
var start = function() {
console.log(req);
};
start();
};
做什麼我確實要從ajax獲取數據並將其記錄在save_username_for_notifications
函數中?
除非你想使用JSONP,否則將你的內容類型改爲application/json? – Tim