$.ajax({
url: 'http://localhost:8080/users/upload_img',
dataType: 'json',
data: dataArr,
type:'POST',
error: function(xhr, error) {
console.log('upload failed');
},
success: function(response) {
console.log('upload success');
}
});
dataArr是一个数组类型。
类似于
[{'name':'mingzi','xingbie':'nan'}]
服务端
router.post('/upload_img',function(req, res,next) {
// 要如何打印结果呢
});收起
慕田峪7331174
相关分类