javascript - Use angularjs to post JSON without a parameter name -
currently have resource so:
return $resource(usersurl, {}, { //the data model loaded via request app query: {method: 'get', params: {}, isarray: false}, putupdate: {method: 'put', params:{}} });
now put json looks like:
{"providerid":"userpass","firstname":"t","lastname":"b","fullname":"t b","email":"emailaddress,"avatarurl":"http:/.....","passwordset":true}
anyway can see doesn't have top level name, if pass information in parameter resource name appended json like:
myparam:{"providerid":"userpass","firstname":"t","lastname":"b","fullname":"t b","email":"emailaddress,"avatarurl":"http:/.....","passwordset":true}
is there away of preventing happening server side doesn't it?
thanks
tom
from question sounds trying use $resource
post arbitrary json data. if data not resource()
should use $http
.
$http.put(theurl, thejsondata);
if resource()
can call method declared when building resource.
myresource.putupdate();
Comments
Post a Comment