lundi 18 janvier 2016

To add JSON data in a file and send the file(for ex: login.js) in a request

I am using ember in the client side .. Currently my request looks like this ..

Ember.$.ajax({      
    url: '/auth/api/authenticate/userpass',
    type: 'POST',
    data: JSON.stringify({
      identification: credentials.identification,
      password: credentials.password
    }),
    contentType: 'application/json',
    dataType: 'json'
  }) ......

Any thoughts on how I can add the data to a JSON file using javascript and embed it in the request ..




Aucun commentaire:

Enregistrer un commentaire