2

I have a RESTful PUT API that can be called using curl like this:

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:

I am new to Backbone. I am trying to call the same from JS by using Backbone like this (but it doesn't work):

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"});

What am I doing wrong?

JayBee
  • 21
  • 1
  • 2
  • 1
    You should take a look to Zach Rabbit's response to http://stackoverflow.com/questions/18504235/understand-backbone-js-rest-calls. – alexm Oct 22 '13 at 14:23
  • possible duplicate of [Getting started with Backbone and a RESTful API](http://stackoverflow.com/questions/11637586/getting-started-with-backbone-and-a-restful-api) – Paul Sweatte Oct 06 '14 at 19:07

0 Answers0