$scope.postdata = function (name, age, adress) { var data = { name: name, age: age, adress: adress }; //Call the services $http.post('http://localhost/InovoTech.Services.DataBridge/api/users/postData',$scope.data, { headers: { 'Content-Type': 'application/json' } } ).then(function (response) { if (response.data) $scope.msg = "Post Data Submitted Successfully!"; }, function (response) { $scope.msg = "Service not Exists"; $scope.statusval = response.status; $scope.statustext = response.statusText; $scope.headers = response.headers(); });
[HttpPost] [Route("postData")] [ResponseType(typeof(Data))] public IHttpActionResult PostUser(Data per) { return null; //return CreatedAtRoute("DefaultApi", new { id = user.UserName }, user); }
[HttpPost] [Route("postData")] [ResponseType(typeof(Data))] public IHttpActionResult PostUser([FromBody] Data per) { return null; //return CreatedAtRoute("DefaultApi", new { id = user.UserName }, user); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)