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

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -