0

this is what i tried,

var items = [{a:1,b:2},{a:3,b:5}];   
$http.put("/url",{data:items}).then(function(response){
     .... 
    ....    
  });

What i am getting in server is

params: { invtransactionserviceData: [ [Object] ] } }

where this goes wrong ?

3 Answers 3

1

Use angular.toJson() because the serialization of that data is not automatic.

Sign up to request clarification or add additional context in comments.

Comments

1

You Must be use JSON.stringify Method. because Object not send to server so convert to string then send to server

var items = [{a:1,b:2},{a:3,b:5}];
$http.put("/url",{data:JSON.stringify(items)}).then(function(response){ .... ....
});

Comments

0

Use $.param() to serialize your data before passing it

$http.put("/url",{data:$.param(items)}).then(function(response){
 .... 
....    
});

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.