jeudi 10 novembre 2016

Sending data from Ember to Django Rest Framework

I am having a problem with EmberJS and Django Rest Framework:

When I tried to create a new record:

this.store.createRecord('user',
        {
          username: name,
          email: 'email@email.com',
          is_staff: false
        }
      ).save();

I get a 409 (conflict) code from the api. But when I send the with jQuery in a post response:

Ember.$.post('http://localhost:8000/users',
        {
          username: name,
          email: 'email@email.com',
          is_staff: false
        });

I get a 201 (created) code. I do not understand why.




Aucun commentaire:

Enregistrer un commentaire