我有一个RESTful PUT API,可以使用curl调用,如下所示:
curl -H "Content-Type: application/json" -X PUT -d "{\"id\":\"xyz\",\"attributeName\":\"privilegedUser\",\"attributeValue\":\"true\"}" https://www.example.com:7777/api/customer/set/attribute -v --insecure --negotiate -u:
我是Backbone的新手。 我试图通过像这样使用Backbone来调用JS(但它不起作用):
var Attribute = Backbone.Model.extend({
url: 'https://www.example.com:7777/api/customer/set/attribute'
});
var privilegeUserAttribute = new Attribute({id: "xyz", attributeName: "privilegedUser"});
privilegeUserAttribute.save({attributeValue: "true"});
我做错了什么?