一,首先是上传数据
记得在angularjs的controller中注入$http依赖
var data = {id: $scope.task_id,
groupId: $scope.task_groupid,
importance: $scope.priority_level,
classname:$scope.classname,
title: $scope.task_title,
date: $scope.todo_date,
detail: $scope.task_detail,
images:$scope.images_list,
name:$scope.name,
record:$scope.recordPath,
donedate:$scope.done_date}
$http({
method: 'POST',
url: 'http://localhost:3000',
params:{
'require': data
}
}).success(function(data,status,headers,config){
}).error(function(data,status,headers,config){
});
$http方法中的data参数,服务端没有接收成功
$http方法中的params参数,服务端接收成功
服务端接收方法是 url.parse(req.url, true).query.params