I am working on a backbone project where my js file is with save function that maps to a model.
this.model.save({
success:function(){
},
attrs : attrs,
.
.
.
.
})
In the backbone model in the sync function i got
sync:function(method, model, options){
if(method == 'update'){
options.url = 'my url here';
options.data = JSON.stringify(_.omit(this.attributes,['username','firstname']))
}
}
If i check the network response the output (in chrome) is
{'password':'','lastname':''}:
Hope you could see the last semi-colon (after the curly closing brackets) coming along with that object sent.
I tested the response with postman without the : and its working fine. So i concluded that semi-colon is added additional to the data on which my PUT request is rejected.
How can i over-come this?