Hi all,
I want submit my Form with POST / RESTful JSON to a WebService.
Unfortunately, JSON does not work, I have to submit my form with String!!
It works but I don't like this way very much, this is why I had to change
the content-type (application/x-www-form-urlencoded).
My code:
'create' : function(task) {
$http.defaults.headers.post["Content-Type"] =
"application/x-www-form-urlencoded";
task.SectionId = task.Sections.SectionId;
var promise = $http({
url: baseURL + 'Tasks/AddOrUpdateTask/',
method: 'POST',
data: $.param(task).replace('&Sections%5BTasks%5D=','')
})
.success(function(data, status, headers, config) {
console.log("saved OK");
})
.error(function(data, status, headers, config) {
alert("saved Error " + status + ' ' + headers);
})
return promise;
},
Thank you for a better understanding. and guide me for a better solution.
regards
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.