1
     var asset = Backbone.Model.extend({
                      urlRoot: 'https://www.example.com/asset/',
                      idAttribute: "assetId",
                 });

     var k = new asset({"assetId":11174355100070});


     k.destroy({
                 headers : { 
                            'Authorization': 'OAuth ' + oauthInfo.oa2,
                            'GSID' : oauthInfo.GSID
                 },
                 contentType: "application/json",
                 success: function(){console.log("success method")},
                 error: function(){console.log("failure error")}
      });

Why is the backbone destroy method triggering the post call instead of delete?

But when type: "DELETE" is passed it is working? Am I missing anything? Why should one pass type when destroy is especially for delete operation.

ProgrammerPer
  • 1,125
  • 1
  • 11
  • 26
VSP
  • 11
  • 1

0 Answers0